zzapper wrote:
Hi,
I can use
if (count($somearray) > 0) to test for an empty array.
why don't you test it.
$a = array();
$b = array(null, null, null);
$c = array(false, false);
$d = array(1, 1, 1);
echo "array \$a: \n---\n";
var_dump(empty($a), count($a), array_filt
Better use is empty(), which supports array as parameter:
$test = array();
if(empty($test)) // true
{
// code...
}
else // false
{
}
Emil Novak, Slovenia, EU
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
I can use
if (count($somearray) > 0) to test for an empty array.
It is possible to have an array with null values which is effectively empty but
fails the above as
it's count (I belive is greater than 0).
Any ideas
--
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/
3 matches
Mail list logo