Home >> PHP >> count() function in PHP

count() function in PHP

The count() function used for returns the total number of elements in an array.

Syntax

count(array,mode);

Example

echo count(array("ram","shyam","ravi"));

Output

3

Post Your Comment

Next Questions
current() function
each() function
end() function
extract() function
in_array() function
key() function
krsort() function
ksort() function
list() function
natcasesort() function
natsort() function
pos() function
prev() function
range() function
reset() function
rsort() function
shuffle() function
sizeof() function
sort() function
uasort() function
uksort() function
usort() function
What is the difference between array_combine() and array_merge()
What are the differences between array_diff(), array_diff_assoc() and array_diff_key()
What is the difference between array_intersect_assoc() and array_intersect_key()

Copyright ©2022 coderraj.com. All Rights Reserved.