How can we know the count/number of elements of an array?

Answer Posted / rajan vardawaj

2 ways:
a) sizeof($array) - This function is an alias of count()
b) count($urarray) - This function returns the number of
elements in an array. Interestingly if you just pass a
simple var instead of an array, count() will return 1.

Is This Answer Correct ?    17 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is better mysql or sql?

708


How to insert a line break in php string?

691


How do you trim spaces in excel?

689


What's the difference between __sleep and __wakeup?

708


What is new static in php?

670






What is the actually used php version?

687


What is is_null() in php?

730


What is php.ini & .htacess file?

714


What is slim framework?

652


What is a php trait?

650


Which function is used in php to search a particular value in an array?

657


What is php explain?

651


What type of errors can be occurred in php?

719


What is echo and print in php?

677


How many php functions are there?

687