Re: Associative vs normal arrays

From: Date: Sun, 02 Feb 2003 17:33:59 +0000
Subject: Re: Associative vs normal arrays
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-134008@lists.php.net to get a copy of this message
No functions that I can think of but you can write one like this: $arrayType = 'numeric'; foreach($myArray as $key => $value) { if(!is_numeric($key)) { $arrayType = 'associative'; } } Also remember that an array can be both! Larry > Is there a way to determine if an array is associative or not? Maybe = > something similar to the is_array() function ??

« previous php.general (#134008) next »