weird array behaviour
| From: | Nick Davies | Date: | Wed, 15 Aug 2001 15:32:42 +0000 |
| Subject: | weird array behaviour | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-62851@lists.php.net to get a copy of this message | ||
I have a function which returns a mulit-dimensional array, but the array
which is returned doesn't "work" for some reason :/
If i print the array within the function using
while (list($key) = each($myArray)) {
while (list($key2, $value2) = each($myArray[$key])) {
print $key . " : " . $key . " : " . $value;
}
}
it works fine but doing the same thing after the array has been returned
jus yields -- Warning: Variable passed to each() is not an array or
object in ... refering to $myArray[$key];
even though if i print $myArray[$key] it tells me that it's an Array :/
Thanks.
Nick.