|
Posted by Tom on 11/06/07 19:32
On Tue, 06 Nov 2007 08:00:44 +0000, David Quinton wrote...
>
>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 arravvys 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?
Once we start getting into multi-dimensional arrays, my brain starts to hurt and
I need to take a nap. : ) All joking aside, they're actually very useful.
Tom
--
NewsGuy Free Trial Accounts
Now a massive 20 Gigabytes of unrestricted downloads !
http://newsguy.com/
Navigation:
[Reply to this message]
|