Sail E0 Webinar

MCQs

Total Questions : 26 | Page 2 of 3 pages
Question 11. What will be the output of the following PHP code?
< ?php
$num = 10;
echo 'What is her age? \n She is $num years old';
?>
  1.    What is her age? \n She is $num years old
  2.    What is her age?She is $num years old
  3.    What is her age? She is 10 years old
  4.    What is her age?She is 10 years old
 Discuss Question
Answer: Option A. -> What is her age? \n She is $num years old


When a string is enclosed within single quotes both variables and escape sequences will not be interpreted when the string is parsed.


Question 12. PHP files have a default file extension of.
  1.    .html
  2.    .xml
  3.    .php
  4.    .ph
 Discuss Question
Answer: Option C. -> .php


.php


Question 13. What does PHP stand for?i) Personal Home Pageii) Hypertext Preprocessoriii) Pretext Hypertext Processoriv) Preprocessor Home Page
  1.    Both (i) and (ii)
  2.    Both (ii) and (iv)
  3.    Only (ii)
  4.    Both (i) and (iii)
 Discuss Question
Answer: Option A. -> Both (i) and (ii)


PHP previously stood for Personal Home Page now stands for Hypertext Preprocessor.


Question 14. Who is the father of PHP?
  1.    Rasmus Lerdorf
  2.    Willam Makepiece
  3.    Drek Kolkevi
  4.    List Barely
 Discuss Question
Answer: Option A. -> Rasmus Lerdorf


Rasmus Lerdorf


Question 15. Which of the looping statements is/are supported by PHP?i) for loopii) while loopiii) do-while loopiv) foreach loop
  1.    (i) and (ii)
  2.    (i), (ii) and (iii)
  3.    All of the mentioned
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> All of the mentioned


All of the mentioned


Question 16. A PHP script should start with ___ and end with ___:
  1.    < php >
  2.    < ? php ?>
  3.    < ? ? >
  4.    < ?php ? >
 Discuss Question
Answer: Option D. -> < ?php ? >


Every section of PHP code starts and ends by turning on and off PHP tags to let the server know that it needs to execute the PHP in between them.


Question 17. Which of the below symbols is a newline character?
  1.    \r
  2.    \n
  3.    /n
  4.    /r
 Discuss Question
Answer: Option B. -> \n


PHP treats \n as newline character.


Question 18. Which of the following is/are a PHP code editor?
ditor?i) Notepadii) Notepad++iii) Adobe Dreamweaveriv) PDT
  1.    Only (iv)
  2.    All of the mentioned.
  3.    (i), (ii) and (iii)
  4.    Only (iii)
 Discuss Question
Answer: Option B. -> All of the mentioned.


Any of the above editors can be used to type php code and run it.


Question 19. We can use ___ to comment a single line?i) /?ii) //iii) #iv) /* */
  1.    Only (ii)
  2.    (i), (iii) and (iv)
  3.    (ii), (iii) and (iv)
  4.    Both (ii) and (iv)
 Discuss Question
Answer: Option C. -> (ii), (iii) and (iv)


/* */ can also be use to comment just a single line although it is used for paragraphs. // and # are used only for single line comment.


Question 20. Which version of PHP introduced Try/catch Exception?
  1.    PHP 4
  2.    PHP 5
  3.    PHP 5.3
  4.    PHP 6
 Discuss Question
Answer: Option B. -> PHP 5


Version 5 added support for Exception Handling.


Latest Videos

Latest Test Papers