Posted by Chung Leong on 11/04/05 08:01
Parrot wrote:
> >The following is what you need to create a array of arrays:
> >
> >function test()
> >{
> > $array[0][0] = "Hello";
> > $array[0][1] = "World";
> > $array[1][0] = "How Are";
> > $array[1][1] = "You?";
> > return $array;
> >}
> >
>
> Yeah, that's the one I tried, but it didn't work.
What do you mean it didn't work? What did you get when you do a
print_r()? The output should be:
Array
(
[0] => Array
(
[0] => Hello
[1] => World
)
[1] => Array
(
[0] => How Are
[1] => You?
)
)
If you're not getting that then you version of PHP is buggy.
Navigation:
[Reply to this message]
|