我有一個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上得到任何警告嗎?你檢查了日誌嗎? –