I'm trying to get the PS4 firmware version from their XML, but for some reason it's returning NULL
.
<?php
$list = simplexml_load_file('http://feu01.ps4.update.playstation.net/update/ps4/list/eu/ps4-updatelist.xml');
if($list) {
echo $list->system_pup[0]['label']; // get firmware version
} else {
echo 'Error opening the XML file.';
}
?>
I have no idea what I'm doing wrong, because I've followed this article and it seems I've done it correctly.
Any ideas?
If accessing the wrong element simplexml doesn't throw an error it just gives you the nothingness that your call returned. You should look at the structure to determine where in the structure your element is. In this case you are off by 1 element.
$list = simplexml_load_file('http://feu01.ps4.update.playstation.net/update/ps4/list/eu/ps4-updatelist.xml');
if($list) {
//print_r($list);
echo $list->region->system_pup[0]['label']; // get firmware version
} else {
echo 'Error opening the XML file.';
}