note 35681 deleted from function.is-array by didou

From: Date: Thu, 11 Sep 2003 07:18:45 +0000
Subject: note 35681 deleted from function.is-array by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-56056@lists.php.net to get a copy of this message
Note Submitter: lg@ifxnw.com.ve ---- Still another way that might be slower on bigger arrays but surer to identify between an asociative and a sequential array is this: function is_assoc($array) { if(! is_array($array)) return false; //Not an array at all foreach($array as $key => $value) { if(is_string($key)) return true; } return false; }

« previous php.notes (#56056) next »