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>
[Back to original message]
|