在我的PHP代码中,我有这个:
$filename = 'data.xml';
$xml = file_get_contents($filename);
$data = simplexml_load_string($xml);
$variable = "";
foreach ($data->file_info as $record)
{
$id1 = $record['id1'];
$id2 = $record['id2'];
}
它在Web服务器上工作得非常好,但是当尝试在本地查看它时(使用xampp)我在我的pgae顶部得到以下输出:
file_info as $record)
{
$id1 = $record['id1'];
$id2 = $record['id2'];
}
(后面是另外100行PHP)
不确定它是否有所作为,它运行的网络服务器正在运行linux,我试图在Windows上使用xampp查看它
答案 0 :(得分:0)
确保在short_open_tag
/将php.ini
更改为<?
时将<?php
设置为开启。如果没有这样做,请检查apache的日志以查看发生了什么。还要检查php是否被定义为httpd.conf
中.php文件的处理程序。