我有一个php代码的问题。 此代码在Linux中运行平稳,但在Windows 7中无法运行。有什么建议吗?PHP代码在Windows 7中无法正常工作apache(localhost)
$xml = simplexml_load_file('data.xml');
if(isset($_POST['confirmOrd'])){
foreach($xml->xpath("orders/order[@id='".$_POST['confirmOrd']."']") as $change){
$change->check = date('d/m/Y');
}
$xml->asXML('data.xml');
}
在windows Apache服务器我得到错误:
警告:主()[function.main]:不能分配给节点阵列(复制子节点或ATTR检测)
什么是你的PHP版本? –
这不是一个错误,只是一个警告。你可以通过使用error_reporting(E_ALL&〜E_WARNING)来抑制它。在你的程序中。 –
你确定你没有在linux上得到任何警告吗?你检查了日志吗? –