Jump to content
php.lv forumi

XML - Palīdziet saprast, kas neiet.


Mikijs

Recommended Posts

Sveiki, varbūt spēsiet palīdzēt saprast kas īsti neiet, strādāju uz servera kurš nerāda kļūdas paziņojumus, arī ja pats uzlieku E_ALL...

 

<?php
 echo '<table>';
$bank="http://www.bank.lv/vk/xml.xml";

$objDOM = new DOMDocument();
 $objDOM->load($bank);

 $cur = $objDOM->getElementsByTagName("Currency");
 foreach($cur as $items) {
		$ID = $items->getElementsByTagName("ID");
		$ID = $ID->item(0)->nodeValue;

		$units = $items->getElementsByTagName("Units");
		$units = $units->item(0).nodeValue;

		$rate = $items->getElementsByTagName("Rate");
		$rate = $rate->item(0).nodeValue;
		echo "<tr><td class='cur-id'>$ID</td><td class='cur-rate'>$rate</td></tr>";
 }
 echo '</table>';
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...