[thelist] Q on PHP array manipulations...
sbeam
sbeam at syxyz.net
Fri Jul 9 08:38:58 CDT 2004
On Friday 09 July 2004 08:54 am, Ken Schaefer wrote:
> : arrays don't have columns or rows. They have keys
> : and values.
>
> Nit pick. I think you may be confusing associative arrays, like hash
> tables, and binary search trees (which have have keys/values) with
> arrays. That said, you are correct in asserting that arrays do not
> have "rows and columns"
uh, who's nit picking now? ;) Actually it's an important distinction,
anyone talking about a "row" in an array is maybe confused about what
is going on in general. Makes technical communication difficult...
Also if you read the PHP docs you'll see that its all key=>value when it
comes to arrays, even so-called 'linear' arrays which are really just
associative arrays with consecutive integers for keys. PHP does not
have regular arrays like most languages. This is one of its
"interesting features" - read the docs for the each() function to taste
the insanity http://us4.php.net/each
or you could look at this, first 2 sentences:
http://www.php.net/manual/en/language.types.array.php
"An array in PHP is actually an ordered map. A map is a type that maps
values to keys."
I don't know or care what they do with arrays internally. It's not a
regular hash since they are ordered.
--
# S Beam - Web App Dev Servs
# http://www.onsetcorps.net/
More information about the thelist
mailing list