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



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

Answer / 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

More PHP Interview Questions

What is strlen php?

0 Answers  


What is the difference between pop3 IMAP and MAPI?

0 Answers  


What changes I have to do in php.ini file for file uploading?

0 Answers  


Tell me is it possible to submit a form with a dedicated button?

0 Answers  


What is a helper function?

0 Answers  






How to remove white spaces from the beginning and/or the end of a string in php?

0 Answers  


what is php stands for?

23 Answers   Infosys, Satyam, Torque Infotech,


What is csrf token and how will you add csrf token in ajax?

0 Answers  


What is the difference between mysql_connect and mysql_pconnect ? Which one is good in terms of performance ?

4 Answers  


What is the difference between apache vs niginx?

0 Answers  


Tell me how to create a session? How to set a value in session? How to remove data from a session?

0 Answers  


Where to put php files in apache server?

0 Answers  


Categories