Forum Moderators: open
Thanks you
[edited by: jatar_k at 12:30 am (utc) on Oct. 31, 2006]
[edit reason] no urls thanks [/edit]
This should do it:
<?php
$file = file_get_contents("http://example.com/NRG_FM.xml");
$doc = new DOMDocument();
$doc->loadXML($file);
foreach($doc->getElementsByTagName('Entry')->item(0)->attributes as $attribute){
if($attribute->name == "Title" ¦¦ $attribute->name == "Artist"){
echo $attribute->name . ": " . $attribute->value . "<br>";
}
}
?>
(ps. you need to change any broken vertical bars to solid vertical bars)
Andrew
[edited by: Little_G at 12:59 pm (utc) on Oct. 27, 2006]
[edited by: jatar_k at 12:30 am (utc) on Oct. 31, 2006]
Firstly, grooverince, did you change any broken vertical bars to solid vertical bars?
Secondly, baron13, you need to assign the return value of a method to a variable and then call the methods from that, so:
$doc->getElementsByTagName('Entry')->item(0)->attributes
$a = $doc->getElementsByTagName('Entry')
$a->item(0)->attributes;
Andrew