πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$color1 = "red";
$color2 = "1";
$color3 = "grey"
echo "$color1" + "$color2" . "$color3";
?>
  • (A) 1grey
  • (B) grey
  • (C) 0
  • (D) red1grey
πŸ’¬ Discuss
βœ… Correct Answer: (A) 1grey
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
echo "This", "was", "a", "bad", "idea";
?>
  • (A) This, was, a, bad, idea
  • (B) This was a bad idea
  • (C) Thiswasabadidea
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) Thiswasabadidea
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
echo "This"."was"."a"."bad"."idea";
?>
  • (A) This, was, a, bad, idea
  • (B) This was a bad idea
  • (C) Thiswasabadidea
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) Thiswasabadidea
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
echo "This","was"|"a","bad"."idea";
?>
  • (A) Thiswasabadidea
  • (B) Thiswasbadidea
  • (C) Thiswas a badidea
  • (D) Thiswas abadidea
πŸ’¬ Discuss
βœ… Correct Answer: (B) Thiswasbadidea
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$one = "Hello";
$two = "World";
echo $one, $two;
?>
  • (A) Hello World
  • (B) Hello
  • (C) World
  • (D) HelloWorld
πŸ’¬ Discuss
βœ… Correct Answer: (D) HelloWorld
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$one = "Hello";
$two = "World";
echo "$one$two";
?>
  • (A) HelloWorld
  • (B) $one$two
  • (C) Hello
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) HelloWorld
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$one = "Hello";
$two = "World";
echo "$one"+"$two";
?>
  • (A) HelloWorld
  • (B) Hello+World
  • (C) 0
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 0
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
echo "This is India";
?>
  • (A) This is India
  • (B) This is India
  • (C) This is
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) This is India
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "My car is a {$cars[0]}";
?>
  • (A) My car is a Volvo
  • (B) My car is a BMW
  • (C) My car is a Toyota
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) My car is a Volvo
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$Country1 = "INDIA";
$Country2 = "1";
$Country3 = "USA";
echo "$Country1" + "$Country2" . "$Country3";
?>
  • (A) USA
  • (B) INDIA
  • (C) INDIA1
  • (D) 1USA
πŸ’¬ Discuss
βœ… Correct Answer: (D) 1USA