Entry
I'm posting to an array variable from my HTML but in the script I get a string reading "Array". Why?
May 12th, 2002 18:10
Philip Olson, Anders Feder,
All arrays will print "Array" if you print it directly, do not do that.
For example:
$arr = array('apple','banana','cranberry');
print $arr; // Array
print $arr[0]; // apple
So treat the array from the form like any other array. Most likely
you'll want to loop through it and do various activities with the names
and values, consider the foreach statement for this:
foreach ($arr as $key => $value) {
print "$key : $value\n";
}
Will output:
0 : apple
1 : banana
2 : cranberry
See:
http://www.php.net/foreach
http://www.php.net/array