note 95684 deleted from function.is-array by danbrown

From: Date: Fri, 15 Jan 2010 18:32:29 +0000
Subject: note 95684 deleted from function.is-array by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-165010@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- Do not use below code, found in earlier comments: <?php function is_assoc($array) { return (is_array($array) && 0 !== count(array_diff_key($array, array_keys(array_keys($array))))); } ?> It is buggy, and therefore array('1'=>'Yes', '0'=>'No') is interpreted as NOT associative!

« previous php.notes (#165010) next »