I am having an issue as the code below is not executing properly.
There is no issue with the code, it works fine on all machines but one.
All other php stuff works though
Just not the foreach loop. So it's gotta be a server config, any ideas as to where I could start looking.
<?
#foreach ($arr1 as $i) {action}
as is the assignment
#integers no quotes req.
$arr1 =array(1,2,3,4,5);
#keys and values
$arr2 =array("file1" => "index.php","file2" => "default.php",);
#values only
$arr3 =array("index1.html","index2.html");
foreach ($arr1 as $i) {
echo $i, "<br>";
}
#echo both key and value
foreach ($arr2 as $key => $index) {
echo "$key - $index", "<br>";
}
foreach ($arr3 as $index) {
echo $index, "<br>";
}
?>
It results in:
Array
Array
Array
Array
Array
file1 - index.php
file2 - default.php
Array
Array
while it should be:
1
2
3
4
5
file1 - index.php
file2 - default.php
index1.html
index2.html