What is the output of the following code? echo count(array("apple", "banana", "cherry"));
- 3
- 6
- 0
- 1
The count function in PHP returns the number of elements in an array. In this case, it counts the elements in the given array, which is 3. So, the output will be 3.
Loading...
Related Quiz
- You're writing a custom exception class in PHP to handle specific types of errors in your application. Which built-in PHP class would you extend to achieve this?
- What is the scope of a variable that is declared within a PHP function?
- What are some steps you might take when creating a MySQL table using PHP?
- Which of the following PHP data types can hold multiple values?
- You are writing a PHP script and you need to establish an FTP connection. How would you do this?