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
Why is node js better than php?
What is user defined function in php?
How do I escape data before storing it into the database?
What are string functions?
What is the use of hooks?
Why php is sometimes called as embedded scripting language?
With a heredoc syntax, do I get variable substitution inside the heredoc contents?
Why die is used in php?
What is the difference between php 5 and php 7?
Tell me how to strip whitespace (or other characters) from the beginning and end of a string?
How to execute an sql query?
What are the encryption functions available in PHP?
How do you pass a variable by value?
What is T_PAAMAYIM_NEKUDOTAYIM?
How many functions are there in php?