Posted by Richard Brooks on 11/04/05 02:31
Parrot wrote:
> On 3 Nov 2005 14:28:49 -0800, "Chung Leong">
> <chernyshevsky@hotmail.com> wrote:
>
>
>>Don't see anything wrong with the code. I suspect the problem lies in
>>the way you access the array. Do a print_r() on the return value and
>>see if you're getting what you're supposed to.
>
>
> I set up a simple test script to try and figure out how to work the
> arrays:
>
> <?
> function test()
> {
> $array[0][0] = "Hello";
> $array[0][1] = "World";
> $array[1][0] = "How Are";
> $array[1][1] = "You?";
>
> return array($array);
> }
>
> $array = test();
> echo $array[0][0];
> ?>
>
> When I run it it just prints out the word "Array".
>
Doing a Google search I came across this URL but the interesting thing
was the last line.
"Multi-dimensional arrays
PHP does not explicitly support multi-dimensional arrays. However PHP
allows arrays of any type of object, including arrays so two dimensional
arrays can be implemented as arrays of arrays. "
<http://www.scit.wlv.ac.uk/~jphb/sst/php/lang/phparrays.html>
Richard.
Navigation:
[Reply to this message]
|