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 : ?
Which one of the following is not a preg PHP function? preg_match_all preg_match preg_matchall preg_split TRUE ANSWER : ? YOUR ANSWER : ?
Parameter flags was added in which version of PHP? PHP 4.0 PHP 4.3 PHP 4.1 PHP 4.2 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); You like dogs. I hate dogs. We should marry. Error Array([0]=>You like dogs. [1]=>I hate dogs. [2]=>We should marry.) Array([0]=>You like dogs. I hate dogs. We should marry.) TRUE ANSWER : ? YOUR ANSWER : ?
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 [5]=>5) Array([1]=> 1) Array([2]=>two [3]=>three [4]=>four) Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5) TRUE ANSWER : ? YOUR ANSWER : ?
Which one of the following functions finds the last occurrence of a string, returning its numerical position? strrpos() strpos() strlast() strlastpos() TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>echo str_pad("Salad", 5)." is good."; is good SaladSaladSaladSaladSalad Salad is good SaladSaladSaladSaladSalad is good is good Salad TRUE ANSWER : ? YOUR ANSWER : ?
How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions. 8 10 7 9 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_divide() preg_unchain() preg_destroy() 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 great My name is Will Pitt I am not great My name is not Will Pitt I am not great My name is not Will Pitt I am great TRUE ANSWER : ? YOUR ANSWER : ?