What will be the output of the following PHP code?<br/>$str = "Hello! My name is Cameron Fox. Coffee?";<br/>$find = array('/is/','/coffee/');<br/>$replace = array('/was/','/tea/');<br/>echo preg_replace ($find, $replace, $str); Hello! My name is Cameron Fox. tea? Hello! My name was Cameron Fox. tea? Hello! My name is Cameron Fox. Coffee? Hello! My name was Cameron Fox. Coffee? TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$foods = array("pasta", "steak", "fish", "potatoes");<br/>$food = preg_grep("/^s/", $foods);<br/>print_r($food); Array ( [1] => steak ) Array ( [0] => pasta [1] => steak [2] => fish [3] => potatoes ) Array ( [0] => potatoes ) Array ( [3] => potatoes ) TRUE ANSWER : ? YOUR ANSWER : ?
Which one of the following preg PHP functions is used to take a string, and put it in an array? preg_split() preg_destroy() preg_unchain() preg_divide() TRUE ANSWER : ? YOUR ANSWER : ?
PHP has long supported two regular expression implementations known as _______ and _______.<br/>1. Perl<br/>2. PEAR<br/>3. Pearl<br/>4. POSIX 1 and 4 2 and 3 1 and 2 2 and 4 TRUE ANSWER : ? YOUR ANSWER : ?
Parameter flags was added in which version of PHP? PHP 4.2 PHP 4.1 PHP 4.0 PHP 4.3 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$name = "What is your name?";<br/>if (preg_match("/name/"),$name)<br/>echo "My name is Will Pitt ";<br/>else<br/>echo "My name is not Will Pitt ";<br/>if (preg_match("/are/"))<br/>echo "I am great"else echo "I am not great"; My name is not Will Pitt I am not great My name is Will Pitt I am not great My name is Will Pitt I am great My name is not Will Pitt I am great TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$line = "You like dogs. I hate dogs. We should marry."<br/>$sen = preg_split('/./', $line);<br/>print_r($sen); Array([0]=>You like dogs. [1]=>I hate dogs. [2]=>We should marry.) Error You like dogs. I hate dogs. We should marry. Array([0]=>You like dogs. I hate dogs. We should marry.) TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following would be a potential match for the Perl-based regular expression /fo{2,4}/ ?<br/>1. fol<br/>2. fool<br/>3. fooool<br/>4. fooooool 1 and 4 2 and 3 Only 1 1, 3 and 4 TRUE ANSWER : ? YOUR ANSWER : ?
Which one of the following regular expression matches any string containing zero or one p? p+ p* p# P? TRUE ANSWER : ? YOUR ANSWER : ?
Which one of the following functions will convert a string to all uppercase? struppercase() str_uppercase() uppercase() strtoupper() TRUE ANSWER : ? YOUR ANSWER : ?