php foreach visible on page
- by Hintswen
In my PHP code I have this:
$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'];
}
And it works perfectly fine on the web server, but when trying to view it locally (using xampp) I get the following output at the top of my pgae:
file_info as $record)
{
$id1 = $record['id1'];
$id2 = $record['id2'];
}
(followed by another 100 or so lines of PHP)
Not sure if it would make a difference, the web server it works on is running linux, and I am trying to view it on windows using xampp)