I have a script where I'm trying to assign an Array values from an include file (because these same variables will be used in several scripts).
It seems to almost work, but when I try to print the variables, I get a different result:
script.php:
<?php
include("test_includes.inc.php");
$these_numbers = $numbers;
echo " <pre> print_r($these_numbers) var_dump($these_numbers)
</pre>
$these_numbers[0]<br>$these_numbers[1]";
?>
and test_includes.inc.php
<?php
$numbers = ARRAY('one','two');
?>
The result:
print_r(Array)
var_dump(Array)
one
two
I guess I don't understand why the print_r() and var_dump() aren't working and if this is the cause of my problems in my real script (where I do a foreach over each element in the array and run a sql query using it).
Thanks, Tev