Returns the size of an array.
This function returns the number of elements in an array. If the parameter provided to count() is not an array, 1 will be returned. The mode parameter is available in PHP 4.2.0 and up. If it is set to one, the elements in the array are counted recursively, which can be useful for multidimensional arrays.
<?php
print count(array("one", "two", "three")) . "<br>";
print count("one");
?> 3
1This example shows count() in use on an array and a string.