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([1]=> 1) Array([2]=>two [3]=>three [4]=>four) Array([0]=>0 [5]=>5) Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5) TRUE ANSWER : ? YOUR ANSWER : ?
POSIX implementation was deprecated in which version of PHP? PHP 5.3 PHP 4 PHP 5.2 PHP 5 TRUE ANSWER : ? YOUR ANSWER : ?
Which one of the following functions will convert a string to all uppercase? strtoupper() struppercase() str_uppercase() uppercase() TRUE ANSWER : ? YOUR ANSWER : ?
How many functions does PHP offer for searching strings using POSIX style regular expression? 8 9 10 7 TRUE ANSWER : ? YOUR ANSWER : ?
Which one of the following preg PHP function is used to do a find and replace on a string or an array? preg_find() preg_replace() preg_findre() preg_find_replace() 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 Will Pitt I am not great My name is Will Pitt I am great My name is not Will Pitt I am great My name is not Will Pitt I am not great TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$text = "this istsome text thatnwe might like to parse.";<br/>print_r(split("[nt]",$text)); this is some text that we might like to parse. Array ( [0] => some text that [1] => we might like to parse. ) [0] => this is [1] => some text that [2] => we might like to parse. Array ( [0] => this is [1] => some text that [2] => we might like to parse. ) 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 ( [0] => pasta [1] => steak [2] => fish [3] => potatoes ) Array ( [0] => potatoes ) Array ( [3] => potatoes ) Array ( [1] => steak ) 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 : ?
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 was Cameron Fox. tea? Hello! My name was Cameron Fox. Coffee? Hello! My name is Cameron Fox. tea? Hello! My name is Cameron Fox. Coffee? TRUE ANSWER : ? YOUR ANSWER : ?