IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Yes, that's largely correct.
Arrays in PHP are farily unique in that most languages at that level offer lists and tables (or dictionaries) as separate structures. PHP puts them together in the one structure, with some slightly odd behaviours with keys as a result.

Arrays are very powerful in PHP, even with a slightly clunky literal notation. You've been exploring using them as a large structure, but they can do a lot of very clever things when treated as a small structure, as well (my favourite is using a short array literal to send named parameters to a function). And nesting! Don't be afraid to next arrays: you can win a lot of organisation using nested loops and nested arrays. And you can learn and use all of that without using things like array_merge(), by the way.

Wade.
"Insert crowbar. Apply force."
New Oh yes, do avoid that
The syntax and operation of array_merge and some of the other "magic" utilities for arrays never became natural for me. Sure, I probably re-invented a wheel or two, but at least I understood what it was doing. Which makes me the guy you always read about in TheDailyWTF that re-invented the String class.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New I had to experiment with them before I understood them.
array_diff I use a little, though carefully. array_merge I don't use - it's a little bit simplistic for they way I often work with arrays that need that operation; the + operator works much better.

OTOH, I use array_filter a bit.

Wade.
"Insert crowbar. Apply force."
     Learning PHP: Comprehending Arrays - (cwbrenn) - (7)
         Re: Learning PHP: Comprehending Arrays - (orion)
         Looks like you have it - (JayMehaffey)
         Arrays and Dictionaries - (ChrisR) - (1)
             And you're the pedant Jay warned about :-) - (drewk)
         Yes, that's largely correct. - (static) - (2)
             Oh yes, do avoid that - (drewk) - (1)
                 I had to experiment with them before I understood them. - (static)

You got the chainsaw. Now find some meat!
36 ms