How to select img src within Tumblr xml file using php?

mkamoua

New Member
I am trying to select the src for the first img within the following post xml. \[code\]<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>\[/code\]I can select the title and post text using php but I havent been able to select the img or its src. \[code\]$title = $xml->posts->post->{'regular-title'};$img = $xml->posts->post->{'regular-body'}->??????;$post = $xml->posts->post->{'regular-body'};\[/code\]Am i using the right method to select the img or is there another way?
 
Back
Top