Page 1 of 1

array()

Posted: Sun Oct 27, 2002 4:51 am
by jamal
Hi Guys,
This may sound very elementary to the expert but to me it
is another Vietnam war. Please can anyone just tell me
why the indexes of the element in the first array() contain
double quotes and the second array does not???

&sound = array ("pig"=>"oink","cow"=>"moo"); and
&measure = array ("inch"=>1,"foot"=>12, "yard"=>36);


Thanks
Jamal

Posted: Sun Oct 27, 2002 5:08 am
by volka
in both arrays the indices are quoted, but in the second the values are not because they are numerical, integers in this case. Only quote string literals

http://www.php.net/manual/en/language.types.php