New PHP language novices learn to use PHP for programming in regular contact with the array. So then we should use PHP function count () to help us calculate the length of the array. In this paper, a small example as we explain PHP function count () of the specific usage.
int count (mixed var)
Back to var in the number of units, usually a array (only one of any other type of cell).
If var is not an array type, will return 1 (Exception: count (NULL) the result is 0).
Warning
PHP function count () does not initialize the variable on the return 0, but for an empty array will return 0. Using isset () to test whether the variable initialization.
Examples 1. Count () example
Sometimes if you do not know PHP function count (), then use the stupid way: select count (*) from table