Handling a remote XML in PHP

Handling a remote XML in PHP

In this example the status of every object will be printed to the screen.

[cc lang=”php” escaped=”true” width=”90%” theme=”default” line_numbers=”on”]
$url = “https://example.com/yourxml.xml”;
$xml = simplexml_load_file($url);
foreach($xml->Object as $XMLOBject)
{
$status =(string) $XMLOBject->Status;
echo $status.’
‘;
}