I am trying to select the src for the first img within the following post xml.
<post>
<regular-title>Testing 1</regular-title>
<regular-body>
<p>This is a test for projects on the website</p>
<p><img src="http://media.tumblr.com/tumblr_m3t0r3saXy1rocfxw.jpg"/></p>
<p><img src="http://media.tumblr.com/tumblr_m3t0s6bPyw1rocfxw.jpg"/></p>
</regular-body>
</post>
I can select the title and post text using php but I havent been able to select the img or its src.
$title = $xml->posts->post->{'regular-title'};
$img = $xml->posts->post->{'regular-body'}->??????;
$post = $xml->posts->post->{'regular-body'};
Am i using the right method to select the img or is there another way?
This should work just fine for you