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);
?>
  1. array
  2. array(4)
  3. object
  4. 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.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.