September 2001
Intermediate to advanced
768 pages
32h 45m
English
int count(mixed variable) Returns the number of elements in a variable.
Returns:
Number of elements in the given variable
Description:
This function returns the number of values contained in the variable given by variable . For scalar variables, this is always 1, unless the variable is unset or contains only NULL, in which case it’s 0. For objects, methods are not counted; nor are attributes having no value (attributes with a value of NULL are counted, however). For arrays, all elements having values—even NULL—are counted. Unset elements are not counted. Elements of subarrays are not counted separately, and each subarray counts as one value.
Note:
sizeof() is an alias for count(); they’re identical in every way except the name.
Version: ...
Read now
Unlock full access