$xmlFileData = file_get_contents('random.xml');
$xmlData = new SimpleXMLElement($xmlFileData);
$totalPages = count($xmlData->page)-1;
The last line of code will tell me how many fields of “page” I have. But it only works on my test server. When I upload it to my real server it doesn’t work any more. How can I count the about of fields with a SimpleXMLElement?