PHP count() Function is used to get the number of elements in an array. A count() function is built-in function in PHP.
Syntax :
count(array $array, int $mode=0);
Parameter,
$array : Required. It is input array.
$mode: Optional. Default value is 0.
0 - Default. It does not count all elements of multidimensional arrays. It is called as COUNT_NORMAL.
1 - It counts all the elements of multidimensional arrays.It is called as COUNT_RECURSIVE.
Return Values :
It returns numbers of elements in an array.
Let's see below example to understand php count() Function in details.
Comments