That is not valid XML, if you make the XML valid it will work
So change the file to
<stores data="4850" times="01010101">
<folder info="storage" DateTime="datetime1" update="212121012" versionNumber="ver1" url="http://url1" locater="location1"/>
<folder info="images" DateTime="datetime2" update="1421748774" versionNumber="ver2" url="http://url2" locater="location2"/>
</stores>
All I did was fix this line
</stores data>
Copy/Paste will get you every time!!!
Then you will get this :-
SimpleXMLElement Object
(
[@attributes] => Array
(
[data] => 4850
[times] => 01010101
)
[folder] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[info] => storage
[DateTime] => datetime1
[update] => 212121012
[versionNumber] => ver1
[url] => http://url1
[locater] => location1
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[info] => images
[DateTime] => datetime2
[update] => 1421748774
[versionNumber] => ver2
[url] => http://url2
[locater] => location2
)
)
)
)
Reply to additional comment
You already have this data in a variable, this line
$xml_ip = simplexml_load_file('file.xml');
creates a PHP SimpleXMLElement object called $xml_ip
You now need to learn how to deal with this object, here is the documentation
And here is a simple bit of code to print out data as a head start.
$xml_ip = simplexml_load_file('file.xml');
echo $xml_ip->attributes()['data'] . PHP_EOL;
echo $xml_ip->attributes()['times'] . PHP_EOL;
foreach ( $xml_ip->folder as $xmlEltObj ) {
foreach ($xmlEltObj->attributes() as $attr => $val) {
echo ' '. $attr . " = " . $val.PHP_EOL;
}
}
Which prints
4850
01010101
info = storage
DateTime = datetime1
update = 212121012
versionNumber = ver1
url = http://url1
locater = location1
info = images
DateTime = datetime2
update = 1421748774
versionNumber = ver2
url = http://url2
locater = location2