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

What is binary safe string?

547


what are interfaces and Abstart classes

1468


How to take a substring from a given string?

538


Tell me how a constant is defined in a php script?

480


where do we use htaccess?

547






List some string function name in php?

544


Write a program to get lcm of two numbers using php?

512


How come the code works, but does not for two-dimensional array of mine?

507


Hi this is amul jani here, i complied my graduation in B.com stream.. but as career i looking for PHP language.. to get shape my career. so is that possible to enter in IT world.. for me how much scope of develop my career in this field.. amul jani

1598


What is the role of php.ini file?

549


How to read one character from a file?

546


Explain about objects in PHP?

578


Are react hooks stable?

521


Can we use php variable in javascript?

536


What language is php written in?

593