I have a rss xml data with contains below format..
<rss version="2.0"
xmlns:ht="http://www.yahoo.com/gold"
<channel>
<item>
<title>Title 1</title>
<description>description 1</description>
<ht:price>$22</ht:price>
</item>
</channel>
so please provide the the how to capture the child object , I have tried
$url = "http://www.yahoo.com/gold/rss/xml";
$xml = simplexml_load_file($url);
for ( $i = 0; $i < 10; $i++ ){
$title = $xml->channel->item[$i]->title;
$description = $xml->channel->item[$i]->description;
$goldprice = $xml->channel->item[$i]->children('http://www.yahoo.com/gold');
$itemprice = $goldprice->price;
echo "</br>" ;
echo $title;
echo "</br>" ;
echo $description;
echo "</br>" ;
echo $itemprice;
echo "</br>" ;
But I am getting error Fatal error: Call to a member function children() on a non-object in...
please provide the solution how to resolve this?
Thanks,