I am trying to use simplexml to pull a thumbnail from the google video rss feed.
google video rss link http://video.google.com/videofeed?docid=-2020029531334253002
When I use this code
$xml = simplexml_load_file('http://video.google.com/videofeed?docid=-2020029531334253002'); var_dump($xml);
The string that I want to get is in bold:
<img src="http://video.google.com/ThumbnailServer2?app=vss&contentid=2059807e5d30b97a&offsetms=395000&itag=w320&lang=en&sigh=TY-gpiPz62_w-wiGSojeV-mG8j8" width="320" height="240" border="1" />
How would I go about doing this? Been trying a few hours with no success, would appreciate any help.
$string = '<img src="http://video.google.com/ThumbnailSer...wiGSojeV-mG8j8" width="320" height="240" border="1" />'; $result = preg_split( '/(src=")(.*?)(\")/', $string, -1, PREG_SPLIT_DELIM_CAPTURE ); print 'URL: ' . $result[2];