You are here: Re: confused on arrays « All PHP « IT news, forums, messages
Re: confused on arrays

Posted by David Quinton on 11/06/07 08:00

On 5 Nov 2007 10:45:44 -0800, Tom <tom@to.com> wrote:

>You can use numeric values in the brackets to create a scalar array...
>
>$array[0] = 'first';
>$array[1] = 'second';
>
>of you can create associative arrays for key/value pairs, such as ...
>
>$array['age'] = 18;
>$array['date'] = '2007-11-05';
>
>Depending on your application, one may be more useful that the other.

When my brain starts to hurt, I like to do a:
foreach ($myarray as $key=>$value){
echo "KEY: $key - VALUE: $value<br>";
}

for 2 dimensional arrays - which often helps me see what's going on.

3 dimensional ones - now that's where the fun really starts! You can
even mix associative with scalar:
$array['age'][7] etc!

http://www.informit.com/articles/article.aspx?p=31840&seqNum=4&rl=1
seems like quite a good Primer?
--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>

 

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

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