load($file)) exit('ERROR'); $time = $xml->getElementsByTagName('GlobalStop'); if ($time->length == 0) exit('ERROR'); $timeValue = $time->item(0)->nodeValue; // if new data or error set take this year if ($timeValue == '' || $timeValue == '1970-01-01T::.Z') $timeValue=date('Y',time()).'-01-01T00:00:00.000Z'; exit($timeValue); ?>