RE: [PHP] Check for Associative Array
| From: | Henning Sittler | Date: | Thu, 18 Jul 2002 17:29:01 +0000 |
| Subject: | RE: [PHP] Check for Associative Array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108305@lists.php.net to get a copy of this message | ||
Ya, except I want the whole array to exist (index and assoc. array), not
just the assoc. array. So, for the time being, I'll just do this:
foreach ($arr as $key=>$value) {
if ( !is_int($key) ) { echo "$key:$value"; }
}
What is HTH ??
Henning Sittler
www.inscriber.com
Try this:
while($row = mysql_fetch_assoc($result)) {
// code here
}
This way, the resulting array will ONLY be associative.
HTH!