Sail E0 Webinar

MCQs

Total Questions : 29 | Page 3 of 3 pages
Question 21. What will be the output if we replace the line $num = preg_grep(“/[0-5]/”, $number); with $num = preg_grep(“/[0-5]/”, $number, PREG_GREP_INVERT);?
  1.    Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5)
  2.    Array([2]=>two [3]=>three [4]=>four)
  3.    Array([1]=> 1)
  4.    Array([0]=>0 [5]=>5)
 Discuss Question
Answer: Option B. -> Array([2]=>two [3]=>three [4]=>four)
Question 22. Which one of the following functions is used to search a string?
  1.    preg_match
  2.    preg_search
  3.    preg_find
  4.    preg_found
 Discuss Question
Answer: Option A. -> preg_match
Question 23. Which one of the following preg PHP function is used to do a find and replace on a string or an array?
  1.    preg_replace()
  2.    preg_find()
  3.    preg_find_replace()
  4.    preg_findre()
 Discuss Question
Answer: Option A. -> preg_replace()
Question 24. What will be the output of the following PHP code?
  1.    My name is Will Pitt I am great
  2.    My name is not Will Pitt I am great
  3.    My name is Will Pitt I am not great
  4.    My name is not Will Pitt I am not great
 Discuss Question
Answer: Option C. -> My name is Will Pitt I am not great
Question 25. What will be the output of the following PHP code?
  1.    Hello! My name was Cameron Fox. tea?
  2.    Hello! My name is Cameron Fox. tea?
  3.    Hello! My name is Cameron Fox. Coffee?
  4.    Hello! My name was Cameron Fox. Coffee?
 Discuss Question
Answer: Option D. -> Hello! My name was Cameron Fox. Coffee?
Question 26. What will be the output of the following PHP code?
  1.    You like dogs. I hate dogs. We should marry.
  2.    Array([0]=>You like dogs. I hate dogs. We should marry.)
  3.    Array([0]=>You like dogs. [1]=>I hate dogs. [2]=>We should marry.)
  4.    Error
 Discuss Question
Answer: Option C. -> Array([0]=>You like dogs. [1]=>I hate dogs. [2]=>We should marry.)
Question 27. Which one of the following preg PHP functions is used to take a string, and put it in an array?
  1.    preg_destroy()
  2.    preg_split()
  3.    preg_unchain()
  4.    preg_divide()
 Discuss Question
Answer: Option B. -> preg_split()
Question 28. Which one of the following is not a preg PHP function?
  1.    preg_match
  2.    preg_match_all
  3.    preg_matchall
  4.    preg_split
 Discuss Question
Answer: Option C. -> preg_matchall
Question 29. Parameter flags was added in which version of PHP?
  1.    PHP 4.0
  2.    PHP 4.1
  3.    PHP 4.2
  4.    PHP 4.3
 Discuss Question
Answer: Option D. -> PHP 4.3

Latest Videos

Latest Test Papers