You are here: Re: Returning a 2 dimensional array « PHP Programming Language « IT news, forums, messages
Re: Returning a 2 dimensional array

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация