English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Thiscount()
The function counts elements in an array or properties in an object. It returns the number of elements in the array.
count(arr, mode)
arr-the specified array.
Pattern-Specify a pattern. Possible values are 0 or1.0: Do not count all elements,1: Count all elements.
Thiscount()
The function returns the number of elements in the array-
Here is an example-
<?php $products = array("Electronics","Footwear"); echo count($products); ?>
Output Result
2