ah, but who says count() may only accept an array?
The PHP manual notes:
Returns the number of elements in var, which is typically an array (since anything else will have one element).
I suppose an alternative method might be to use:
if (is_array($varname) && count($varname) > 0) {
//do something
}