Will you please help me how can I extract this code with simplexml, this is sample xml feed from flickr here is a sample xml feed from flickr http://api.flickr.com/services/feeds/photos_public.gne?tags=Ligabue <link rel="enclosure" type="image/jpeg" href="http://farm3.static.flickr.com/2061/1804769629_383ae90c0c_o.jpg" /> Code (markup): From the code above I want to get the url only which is http://farm3.static.flickr.com/2061/1804769629_383ae90c0c_o.jpg Thanks in advance...
$url = 'http://api.flickr.com/services/feeds/photos_public.gne?tags=Ligabue'; $xml = simplexml_load_file($url); foreach ($xml->entry AS $entry) { echo '<img src="', $entry->link[2]['href'], '" /><br />', "\n"; } PHP: