PHP count() Function is used to get the number of elements in an array. A count() function is built-in function in PHP.
count(array $array, int $mode=0);
$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.
Leave a Reply
Your email address will not be published. Required fields are marked *