PHP Array Count Example | PHP count() Function Tutorial is today’s topic. PHP count() function returns the number of items in the array. PHP array count() method is used to count the items of an array or the properties of an object.
For objects, if you have installed SPL, then you can hook into count() by implementing the interface Countable. The interface has only one method, Countable::count(), which returns a return value for the count() function.
PHP count() function count all elements in an array or something in an object. See the following syntax.
count(array,mode);
The array parameter is required, and it returns the number of elements in the array.
#php #php array count