I have the below XML Structure below but I am unsure how I can get direct access to the URL so that I can use it as a src in my image tag.
PHP Structure:
$images = $url->property->photos
<img src="'.$images.'" width="233" height="154" /> - Testing URL
General XML Structure:
<photos>
<photo>
Information
</photo>
</photos>
XML Structure:
["photos"]=>
object(SimpleXMLElement)#118 (2) {
["@attributes"]=>
array(1) {
["count"]=>
string(2) "43"
}
["photo"]=>
array(43) {
[0]=>
string(97) "http://www.domain.co.nz/images/6f8bc4855bface1ad2c35635625fdbb4c3a11537.jpeg"
[1]=>
string(97) "http://www.domain.co.nz/images/fcb36e4a3465b934490d44e6bb8e1a8192cb466d.jpeg"
[2]=>
string(97) "http://www.domain.co.nz/images//c1e2c792832a08f881bb24756137a63a19c7070d.jpeg"
[3]=>
string(97) "http://www.domain.co.nz/images/b6d9a3c52c7fba81553edb9101c80d273c16ee3c.jpeg"
I assume you may have multiple properties and you want to list each one. If you only have one, or only want to list the first one, you can safely remove the first foreach loop: