note 15217 added to language.types.array
| From: | admmath at cooptel dot qc dot ca | Date: | Fri, 31 Aug 2001 23:39:51 +0000 |
| Subject: | note 15217 added to language.types.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17478@lists.php.net to get a copy of this message | ||
Hi, just wanted to add a note on multidimentional arrays..
the parser seems to have problems parsing $var[$x][$y] in some cases, at least with the version
I'm using.
for ($x=0; $x<$xcount; $x++)
{
for ($y=0; $y<$ycount; $y++)
{
echo "test $somearray[$x][$y]\n";
}
}
fails.. it parses $somearray[$x], followed by [$y], which prints:
"Array[0], Array[1], ...".
Instead, do:
$tempvar = $somearray[$x][$y];
echo "test $tempvar\n";
http://www.php.net/manual/en/language.types.array.php