Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
PHP

Journal tmhsiao's Journal: Ummm.... why would you do that?

count (PHP 3, PHP 4 , PHP 5)
count -- Count elements in a variable
Description
int count ( mixed var [, int mode])

Returns the number of elements in var, which is typically an array (since anything else will have one element).

If var is not an array, 1 will be returned (exception: count(NULL) equals 0).

Except, for some reason, count($var) where $var == NULL returns 1.

WTF?

Thus spake the master programmer: "After three days without programming, life becomes meaningless." -- Geoffrey James, "The Tao of Programming"

Working...