Posted by Richard Brooks on 11/04/05 02:28
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".
>
> When I replace the "echo $array[0][0];" line with "print_r ($array);"
> it gives me:
>
> Array ( [0] => Array ( [0] => Array ( [0] => Hello [1] => World ) [1]
> => Array ( [0] => How Are [1] => You? ) ) )
>
> Is it returning a 3 dimensional array or something??
I tend to go this site a lot!
<http://uk.php.net/types.array>
Richard.
Navigation:
[Reply to this message]
|