Posted On: Apr 15, 2024
PHP array count
In PHP Programming Language we can get count or the total number of elements of an array using count() function.
count() function in PHP is used to get the length of an array.
Syntax:
count(var array_variable, mode)
Where array_variable is variable whose elements to be counted and the mode is an optional argument to specify the mode to be the use of counting recursive or normal
Usage:
$php_array= [1,10,5,38]; echo count($php_array); // prints 4 as output.
You can get the length of an array in PHP by using
Never Miss an Articles from us.
T_PAAMAYIM_NEKUDOTAYIM is scope resolution operator used as :: (double colon) .Basically, it used to call static methods/variables of a Class...
In PHP == is equal operator and returns TRUE if $a is equal to $b after type juggling and === is Identical operator and return TRUE if $a is equal to $b, and they are of the same data type...