You are here: Re: Multi-Dimensional Arrays In PHP ... ??? « PHP Programming Language « IT news, forums, messages
Re: Multi-Dimensional Arrays In PHP ... ???

Posted by Erwin Moller on 07/25/06 08:37

David T. Ashley wrote:

> Hi,
>

Hi,

> Aside from the obvious recursive syntax for initialization,
>
> $x = array( ... array( ...)),
>
> what is the best way to deal with multi-dimensional arrays in PHP?

That question is too general to give a sensible answer.
It depends on what you need to accomplish.
eg: You can use the hash indexing, or the normal (integer) indexing.
Why should 1 be better? Depends on your situation.
If you are using a database an associative indexing could make sense for
rows. In other situations the integer indexing makes more sense.

>
> It seems there is no syntax like $x[i][j][k]???

Yes there is.

>
> Thanks, Dave.

Dave, read this:
http://nl2.php.net/manual/en/ref.array.php

It will clear up a lot of questions.
And one tip: In my experience: Instead of thinking of multidimensional
arrays, it is often simpler and clearer to think of arrays that contain
arrays.

Regards,
Erwin Moller

 

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

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