Re: test for associative or numerically indexed array
| From: | cpaul | Date: | Thu, 20 Mar 2003 11:01:47 +0000 |
| Subject: | Re: test for associative or numerically indexed array | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140414@lists.php.net to get a copy of this message | ||
> So much for the "theory" - what are you really trying to achieve? Maybe
> there's something you can redesign so you're not relying on the fact if an
> array is "enumerated" or not.
thanks very much for your help - i understand now that no matter what
kind of array i think i'm making, it is being morphed into an associative
array. i half-understood this from the docs, but was puzzled.. i expected
the behaviour of an array in other languages, which even if i were to
define an array in this sequence:
$arr[2] = "z";
$arr[0] = "x";
$arr[1] = "y";
would shuffle itself internally into a sequence like: x, y, z.
but in php this obviously isn't the case, and it remains: z, x, y.
thanks again for your time.
--
chris paul