Sail E0 Webinar

MCQs

Total Questions : 75 | Page 4 of 8 pages
Question 31. What will be the output of the following PHP code?function do($myString) {echo strpos($myString, "donkey",0);}do("The donkey looks like a horse.");
  1.    4
  2.    5
  3.    None of the mentioned
  4.    2
 Discuss Question
Answer: Option A. -> 4
Question 32. What will be the output of the following PHP code?echo str_pad("Salad", 5)." is good for health.";
  1.    is good for health SaladSaladSaladSaladSalad
  2.    SaladSaladSaladSaladSalad is good for health
  3.    is good for health Salad
  4.    Salad is good for health
 Discuss Question
Answer: Option D. -> Salad is good for health
Question 33. What will be the output of the following PHP code?function one() {echo " this works";function two() {echo "this too works";}}one();two();
  1.    this works this too works
  2.    error
  3.    this works
  4.    this worksthis too works
 Discuss Question
Answer: Option D. -> this worksthis too works
Question 34. What will be the output of the following PHP code?$title = "O'malley wins the heavyweight championship!";echo ucwords($title);
  1.    O’Malley Wins The Heavyweight Championship!
  2.    O’Malley wins the heavyweight championship!
  3.    O’malley Wins The Heavyweight Championship!
  4.    o’malley wins the heavyweight championship!
 Discuss Question
Answer: Option D. -> o’malley wins the heavyweight championship!
Question 35. What will be the output of the following PHP code?function onespan>() {define("const","I am awesome!");echo constant("const");}one();
  1.    const
  2.    “const”,”I am awesome!”
  3.    const, I am awesome!!
  4.    I am awesome!!
 Discuss Question
Answer: Option D. -> I am awesome!!
Question 36. What will be the output of the following PHP code?$str = addslashes('What does "yolo" mean?');echo($str);
  1.    What does ”yolo” mean?
  2.    What does /”yolo/” mean?
  3.    What does ”yolo” mean?
  4.    What does ”yolo” mean?
 Discuss Question
Answer: Option A. -> What does ”yolo” mean?
Question 37. What will be the output of the following PHP code?echo lcfirst("welcome to India");
  1.    welcome to India
  2.    welcome to india
  3.    Welcome to India
  4.    Welcome to india
 Discuss Question
Answer: Option A. -> welcome to India
Question 38. What will be the output of the following PHP code?$str = "Hello world. It's a beautiful day.";print_r (explode(" ",$str));
  1.    Array ( [0] => Hello [1] => world. [2] => It’s [3] => a [4] => beautiful [5] => day. )
  2.    Array ( [1] => Hello [2] => world. [3] => It’s [4] => a [5] => beautiful [6] => day. )
  3.    Hello world. It’s a beautiful day
  4.    Array ( [0] => Hello [0] => world. [0] => It’s [0] => a [0] => beautiful [0] => day. )
 Discuss Question
Answer: Option A. -> Array ( [0] => Hello [1] => world. [2] => It’s [3] => a [4] => beautiful [5] => day. )
Question 39. What will be the output of the following PHP code?echo hex2bin("48656c6c6f20576f726c6421");
  1.    This is PHP!
  2.    welcome to india
  3.    Hello World!
  4.    MCQ questons
 Discuss Question
Answer: Option C. -> Hello World!
Question 40. What will be the output of the following PHP code?echo ucwords("i love my country");
  1.    I love my country
  2.    i love my Country
  3.    I Love My Country
  4.    I love my Country
 Discuss Question
Answer: Option C. -> I Love My Country

Latest Videos

Latest Test Papers