What will be the output of the following PHP code?
  1.     <?php
  2.     $number = array(0,1,two,three,four,5);
  3.     $num = preg_grep("/[0-5]/", $number);
  4.     print_r($num);
  5.     ?>

Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5)
Array([2]=>two [3]=>three [4]=>four)
Array([1]=> 1)
Array([0]=>0 [1]=>1 [5]=>5)
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);?

Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5)
Array([2]=>two [3]=>three [4]=>four)
Array([1]=> 1)
Array([0]=>0 [5]=>5)
Which one of the following functions is used to search a string?

preg_match
preg_search
preg_find
preg_found
What will be the output of the following PHP code?
  1.     <?php
  2.     $name = "What is your name?"
  3.     if (preg_match("/name/"),$name)
  4.     echo "My name is Will Pitt ";
  5.     else
  6.     echo "My name is not Will Pitt ";
  7.     if (preg_match("/are/"))
  8.     echo "I am great"
  9.     else
  10.     echo "I am not great";    
  11.     ?>

My name is Will Pitt I am great
My name is not Will Pitt I am great
My name is Will Pitt I am not great
My name is not Will Pitt I am not great
Which one of the following preg PHP function is used to do a find and replace on a string or an array?

preg_replace()
preg_find()
preg_find_replace()
preg_findre()
What will be the output of the following PHP code?
  1.     <?php
  2.     $str = "Hello! My name is Cameron Fox. Coffee?"
  3.     $find = array('/is/','/coffee/');
  4.     $replace = array('/was/','/tea/');
  5.     echo preg_replace ($find, $replace, $str);
  6.     ?>

Hello! My name was Cameron Fox. tea?
Hello! My name is Cameron Fox. tea?
Hello! My name is Cameron Fox. Coffee?
Hello! My name was Cameron Fox. Coffee?
Which one of the following preg PHP functions is used to take a string, and put it in an array?

preg_destroy()
preg_split()
preg_unchain()
preg_divide()
Which one of the following is not a preg PHP function?

preg_match
preg_match_all
preg_matchall
preg_split
Parameter flags was added in which version of PHP?

PHP 4.0
PHP 4.1
PHP 4.2
PHP 4.3