Below is a line from an XML feed ( YouTube API 2.1 ):
<media:player url='http://www.youtube.com/watch?v=ksrHwD9cZjQ&feature=youtube_gdata_player'/>
How can I use PHP ( SimpleXml ) to retrieve only the video ID which is in our case ksrHwD9cZjQ
located between ?v=
and &
?
I used $url = (string)$media->group->player->attributes()->url;
but it retrieves the entire URL.
Regards,
Thank you !