file1.php:
include("file2.php");
reset($my_array);
while($array_cell = each($my_array)) {
echo $array_cell['key']." -> ".$array_cell['value']."<br />";
}
file2.php:
$my_array[1] = "one";
$my_array[2] = "two";
$my_array[3] = "three";
$my_array[4] = "four";
the above i would exect to output the contents of the array built in file2, but it doesn't. if i copy all of the code from file2 into file1 it works fine. i have checked my include paths and the file is being included. what do i need to do to make this work?