Q. Which programming language does PHP resemble?

  • (A) JavaScript
  • (B) VBScript
  • (C) Perl and C
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) Perl and C

Q. What is the output of PHP code given below?

Code:
<?php
$x = 8;
$y = 8.0;
echo ($x === $y);
?>
  • (A) No Output
  • (B) 8 === 8
  • (C) 0
  • (D) 1
πŸ’¬ Discuss
βœ… Correct Answer: (A) No Output

Q. Which method sends input to a script via a URL?

  • (A) GET
  • (B) POST
  • (C) Both
  • (D) None
πŸ’¬ Discuss
βœ… Correct Answer: (A) GET

Q. PHP is an example of _______ scripting language.

  • (A) Browser-side
  • (B) Client-side
  • (C) Server-side
  • (D) In-side
πŸ’¬ Discuss
βœ… Correct Answer: (C) Server-side

Q. _______ variable is not a predefined variable.

  • (A) $GET
  • (B) $POST
  • (C) $ASK
  • (D) $REQUEST
πŸ’¬ Discuss
βœ… Correct Answer: (C) $ASK

Q. ______ symbol is a newline character.

  • (A) \n
  • (B) \r
  • (C) \t
  • (D) /n
πŸ’¬ Discuss
βœ… Correct Answer: (A) \n

Q. Variables always start with a _____ in PHP

  • (A) Euro-sign
  • (B) Pond-sign
  • (C) Yen-sign
  • (D) Dollar-sign
πŸ’¬ Discuss
βœ… Correct Answer: (D) Dollar-sign

Q. Which function is used for testing the type of PHP variable?

  • (A) whattype()
  • (B) showtype()
  • (C) gettype()
  • (D) settype()
πŸ’¬ Discuss
βœ… Correct Answer: (C) gettype()

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

Code:
<?php
$m = 5;
while (++$m)
{   
    while ($m > 0)
        print $m;
}
?>
  • (A) 0
  • (B) Error
  • (C) Nothing
  • (D) 66666666.......infinite time
πŸ’¬ Discuss
βœ… Correct Answer: (D) 66666666.......infinite time

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

Code:
<?php
$number = 5;
while (++$number)
{   
    while ($number --> 0)
        print $number;
}
?>
  • (A) Error
  • (B) 5
  • (C) 543210
  • (D) 0
πŸ’¬ Discuss
βœ… Correct Answer: (C) 543210