- var_dump: documentation ( source)
- simplexml_load_string: documentation ( source)
<?php
$xmlstr = <<<XML
<Property>
<images>
<image number="1">
<image>http://www.blah.net/shared/depot/3168/biens/149506/images/627783.jpg
</image>
<image number="2">
<image>http://www.blah.net/shared/depot/3168/biens/149506/images/627794.jpg</image>
</image>
<image number="3">
<image>http://www.blah.net/shared/depot/3168/biens/149506/images/627792.jpg
</image>
</images>
</Property>
XML;
$xml = simplexml_load_string($xmlstr);
foreach ($xml->images->image as $image) {
// create an array $images with number as index and url as value
$i=intval($image['number']);
$images[$i]=(string)$image;
}
var_dump($images);
?>