op*********@yahoo.com wrote in news:1109517346.824559.113520
@f14g2000cwb.googlegroups.com:
Hello,
What is a common way to print elements of a multidimensional array? I
treid to do it in the straightforward way:
$input_list[0][0] = "Something";
print "$input_list[0][0]";
And it does not work.
You're close. PHP automatically expands variables inside of quotation
marks. Thus, when you write
print "$input_list[0][0]";
PHP sees this as a string because it's in quotation marks, and attempts
to replace the text "$input_list" with the value of the $input_list
variable. In this case, $input_list is an array, and trying to print or
echo an array by name results in the string "Array."
To solve this problem, just remove the quotation marks:
print $input_list[0][0];
hth
--
Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources