Home »
MCQs »
PHP MCQs
What will be the output of the following PHP code (7)?
37. What will be the output of the following PHP code?
<?php
$Laptops = array(
"MAC",
"Lenovo",
"Dell",
"HP"
);
echo gettype($Laptops);
?>
- array
- array(4)
- object
- string
Answer: A) array
Explanation:
In the above PHP code, the type of the Laptops variable is an array and the function gettype() returns the type of the variable. Thus, the output will be array.