note 10007 deleted from function.sizeof by philip

From: Date: Sat, 24 Nov 2001 19:48:13 +0000
Subject: note 10007 deleted from function.sizeof by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-21244@lists.php.net to get a copy of this message
Usually sizeof(array array) returns 1, if no element of the array is set. To get 0 as return value, you can use instead: function size_of($check_array) { $assigneditems=sizeof($check_array); if (!isset($check_array[0])) $assigneditems=0; return $assigneditems; } ... $i = size_of($my_array); ... (returns 0 if the array is empty)

« previous php.notes (#21244) next »