Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199807

[PHP3] "multidim. array" problem From: by way of Andi Gutmans (defaultuser <email protected>)
Date: 07/02/98

Hi,

I'm sorry for not using the bug report form in www.php3.org,
but I won't like to mess up your bug-database, if this is not a bug.

Short description:
Multidimensional arrays in double quotes (e.g. "$a[b][1]")
are not expanded in the right way.

Long description and examples:
$a[1] = "hi";
echo $a[1], " $a[1] \n";
# result: hi hi
# This is correct.

$a[b][1] = "hi";
echo $a[b][1] , " $a[b][1] \n";
# result: hi Array[1]
# This is not correct.
# There is no change in the behaviour,
# if I put b in double quotes: ["b"] (if it is possible).

echo " $a{[b][1]} \n";
# results: Array{[b][1]}

echo " ${a[b][1]} \n";
# results: Parse error</b>: parse error, expecting `'}''

# It is quiet clear, that printf("%s \n",$a[b][1]); will work,
# but multidimensional arrays
# are not substituted correctly in double quotes, are they?

I would be very pleased, if you could show me how to use
the multidimensional arrays in the right way (documentation is very
rar).

sylag
Christian Mosch (mosch <email protected>)

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive: http://www.tryc.on.ca/php3.html