有这样的代码:
if (file_exists('my.xml')) {
$xml = simplexml_load_file('my.xml');
if($xml === NULL)
echo('ERR NULL $xml</br>');
else{
echo('> my.xml opened</br>');
print_r($xml);
}
}
foreach($xml->data->record as $records){
echo $records->data_to_retrive, PHP_EOL;
}
echo('> Ended</br');
现在,输出如下所示:
> my.xml opened
> Ended
那有什么问题呢?为什么它t show data_to_retrive, and print_r($xml) don
不起作用?我卡在这里,差点头疼。