note 68174 deleted from function.is-array by danbrown

From: Date: Sat, 27 Dec 2008 16:48:36 +0000
Subject: note 68174 deleted from function.is-array by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-148564@lists.php.net to get a copy of this message
Note Submitter: rjg4013 at rit dot edu ---- To add to the chaos (or perhaps clarification) of these notes, here's another is_associative_array() function that I made and use.. <?php function is_associative_array( $var ) { return is_array( $var ) && !is_numeric( implode( array_keys( $var ) ) ); } ?> I guess with this logic you could do the following too: <?php function is_sequential_array( $var ) { return is_array( $var ) && is_numeric( implode( array_keys( $var ) ) ); } ?> I never saw a reason to check if it was empty because if it is, the type seems inconsequential. RJ Gilligan

« previous php.notes (#148564) next »