note 15718 added to language.types.array
| From: | wasupvegeta at yahoo dot com | Date: | Thu, 27 Sep 2001 18:03:30 +0000 |
| Subject: | note 15718 added to language.types.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18377@lists.php.net to get a copy of this message | ||
when using multi-dimensional arrays, there is a specific way an array must be output for it to work
correctly. for example:
$array[0][0]="hey";
$array[0][1]="whats going on";
//this echo wont display the values
//produces "Array[0] Array[1]"
echo "$array[0][0]" . " " . "$array[0][1]";
//this one will
//produces "hey whats going on"
echo $array[0][0] . " " . $array[0][1];
if you want to echo the value of an array, make sure you dont put the array variable inside quotes
as it will not echo the actual value contained in the array location. It took me an hour to find out
why my values werent printing, turns out i had the array locations echoed from inside quotes, which
was erroneous.
--
http://www.php.net/manual/en/language.types.array.php
http://master.php.net/manage/user-notes.php?action=edit+15718
http://master.php.net/manage/user-notes.php?action=delete+15718
http://master.php.net/manage/user-notes.php?action=reject+15718