Hello,
I'm using SimpleXML to parse a YouTube search feed. I want to get the first result in the feed after searching for a term. Right now my code looks like this:
set_time_limit(0);
// Include needed files
require_once "config.php";
$xml = simplexml_load_file('http://gdata.youtube.com/feeds/base/videos?q=V.I.P.+KE%24HA&client=ytapi-youtube-search&v=2');
print_r($xml->entry[0]->link);
The output for the code above is:
SimpleXMLElement Object
(
[@attributes] => Array
(
[rel] => alternate
[type] => text/html
[href] => http://www.youtube.com/watch?v=TveGAmLdn8k&feature=youtube_gdata
)
)
How can i get the value of "href" ?
Thank you.