PHP Arrays Multiple choice question

Exercise :: Arrays - General Questions

This section contains a lot of Question with answer and explanation.

1) Which is a better way to check if an array has more than one element

sizeof() is an alias for count(), they work the same.


You can use this if (sizeof($arr) > 1) { .... } Or if (count($arr) > 1) { .... }