Q. There is a variable "name" that contains the name of a person, which is/are the correct echo statement(s) to print the "name" suffix with "Hello".

  • (A) echo "Hello $name";
  • (B) echo "Hello " . $name;
  • (C) echo ("Hello $name");
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. What is the correct syntax of print statement in PHP?

  • (A) print
  • (B) print()
  • (C) print = ()
  • (D) Both A and B.
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both A and B.

Q. There is a variable "name" that contains the name of a person, which is/are the correct print statement(s) to print the "name" suffix with "Hello".

  • (A) print "Hello $name";
  • (B) print "Hello " . $name;
  • (C) print ("Hello $name");
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. What will be the output of the following PHP code?

Code:
<?php
$a = 5;
$b = 10;

print ("$a, $b+10");
?>
  • (A) 5, 10+10
  • (B) 5, 20
  • (C) 5 10+10
  • (D) 5 20
πŸ’¬ Discuss
βœ… Correct Answer: (A) 5, 10+10

Q. What will be the output of the following PHP code?

Code:
<?php
var_dump (print "Hello");
?>
  • (A) Helloint(5)
  • (B) Helloint(6)
  • (C) Helloint(1)
  • (D) Hellonumber(5)
πŸ’¬ Discuss
βœ… Correct Answer: (C) Helloint(1)

Q. Which data type is not supported by PHP?

  • (A) Integer
  • (B) Complex
  • (C) Float
  • (D) String
πŸ’¬ Discuss
βœ… Correct Answer: (B) Complex

Q. String is placed within _____.

  • (A) Double quotes ("")
  • (B) Single quotes ('')
  • (C) Both A and B
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both A and B

Q. A PHP integer data type can store values between ____.

  • (A) -65,536 and 65,535
  • (B) 0 and 4,294,967,295
  • (C) -(2^63) and (2^63)-1
  • (D) -2,147,483,648 and 2,147,483,647
πŸ’¬ Discuss
βœ… Correct Answer: (D) -2,147,483,648 and 2,147,483,647

Q. What will be the output of the following PHP code?

Code:
<?php  
$x = true;
var_dump($x);
?>
  • (A) boolean('true')
  • (B) boolean(true)
  • (C) bool(true)
  • (D) bool('true')
πŸ’¬ Discuss
βœ… Correct Answer: (C) bool(true)

Q. What will be the output of the following PHP code?

Code:
<?php
$Laptops = array(
    "MAC",
    "Lenovo",
    "Dell",
    "HP"
);
echo gettype($Laptops);
?>
  • (A) array
  • (B) array(4)
  • (C) object
  • (D) string
πŸ’¬ Discuss
βœ… Correct Answer: (A) array