Re: Associative vs normal arrays

From: Date: Sat, 17 Mar 2001 02:44:19 +0000
Subject: Re: Associative vs normal arrays
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-44352@lists.php.net to get a copy of this message
eschmid+sic@s.netic.de wrote: > > There are only assotiative arrays in PHP. > > PHP has associative and numeric (normal) arrays. But is_array() says > only if it is an array or not. The distinction could only be made if > you look at keys. Keys can be integers or strings. I hope this was > correct, if not, Andrei can correct me :) If I'm not completely mistaken, PHP has only associative arrays, which can act more or less like "normal" indexed arrays when numbers are used as keys, which is the default when no keys are set explicitly, like in: $arr = array('a', 'b', 'c'); which equals $arr = array(0 => 'a', 1 => 'b', 2 => 'c'); But they are still associative, afaik. However, I agree, the only way to make a distinction is to look if the keys are integers. regards Wagner -- Assumption is the mother of all fuck-ups.

« previous php.general (#44352) next »