Sail E0 Webinar

MCQs

Total Questions : 75 | Page 5 of 8 pages
Question 41. What will be the output of the following PHP code?echo strtr("Hilla Warld","ia","eo");
  1.    ia
  2.    Hello World
  3.    eo
  4.    Hilla Warld
 Discuss Question
Answer: Option B. -> Hello World
Question 42. What will be the output of the following PHP code ?function TV($string) {echo "my favourite TV show is ".$string;function b() {echo " I am here to spoil this code";}}b();
  1.    Error
  2.    My favourite TV show isI am here to spoil this code
  3.    I am here to spoil this code
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Error
Question 43. What will be the output of the following PHP code ?function A1($x) { switch($x) {case 1://this statement is the same as if($x == 1)echo 'Case 1 was executed.';break;case 2://this statement is the same asif($x == 2)echo 'Case 2 was executed.';break;case 3://this statement is the same asif($x == 3)echo 'Case 3 was executed.';break;case 4://this statement is the same asif($x == 4)echo 'Case 4 was executed.';break;default://this statement is the same as if $x does not equal the other conditionsecho 'Default was executed.';break;}}A1(9);
  1.    Case 4 was executed
  2.    Case 2 was executed
  3.    Default was executed
  4.    Case 1 was executed
 Discuss Question
Answer: Option A. -> Case 4 was executed
Question 44. What will be the output of the following PHP code?echo stripos("I love php, I love php too!","PHP");
  1.    10
  2.    7
  3.    3
  4.    8
 Discuss Question
Answer: Option B. -> 7
Question 45. What will be the output of the following PHP code ?function uppercase($string) {echo ucwords($string);}$wow = "uppercase";$wow("Time to live king size");
  1.    Time To Live King Size
  2.    TIME TO LIVE KING SIZE
  3.    Uppercase
  4.    Time to live king size
 Discuss Question
Answer: Option A. -> Time To Live King Size
Question 46. What will be the output of the following PHP code ?function calc($num1, $num2){$total = $num1 * $num2;}$result = calc(42, 0);echo $result;
  1.    84
  2.    0
  3.    42
  4.    Error
 Discuss Question
Answer: Option D. -> Error
Question 47. What will be the output of the following PHP code ?function TV($string){echo "my favourite TV show is ".$string;function b() {echo " I am here to spoil this code";}}function b(){echo " I am here to spoil this code";}b();TV("Sherlock");
  1.    Error
  2.    None of the mentioned
  3.    My favourite TV show isI am here to spoil this code
  4.    I am here to spoil this code
 Discuss Question
Answer: Option A. -> Error
Question 48. What will be the output of the following PHP code ?function TV($string){echo "my favourite TV show is ".$string;function b() {echo " I am here to spoil this code";}}a("Sherlock");b();
  1.    None of the mentioned
  2.    Error
  3.    I am here to spoil this code
  4.    my favourite TV show is SherlockI am here ro spoil this code
 Discuss Question
Answer: Option D. -> my favourite TV show is SherlockI am here ro spoil this code
Question 49. What will be the output of the following PHP code ?function calc($num1, $num2){$total = $num1 * $num2;return $total; }$result = calc(42, 0);echo $result;
  1.    42
  2.    0
  3.    84
  4.    Error
 Discuss Question
Answer: Option B. -> 0
Question 50. What will be the output of the following PHP code ?function TV($string) {echo "my favourite TV show is ".$string;function b() {echo " I am here to spoil this code";}}function b() {echo " I am here to spoil this code";}b();
  1.    Error
  2.    I am here to spoil this code
  3.    my favourite TV show isI am here to spoil this code
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> I am here to spoil this code

Latest Videos

Latest Test Papers