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.) Array([0]=>You like dogs. I hate dogs. We should marry.) Error You like dogs. I hate dogs. We should marry. TRUE ANSWER : ? YOUR ANSWER : ?
Which one of the following is not a preg PHP function? preg_match_all preg_match preg_split preg_matchall 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 ( [3] => potatoes ) Array ( [0] => pasta [1] => steak [2] => fish [3] => potatoes ) Array ( [0] => potatoes ) Array ( [1] => steak ) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$number = array(0,1,two,three,four,5);<br/>$num = preg_grep("/[0-5]/", $number);<br/>print_r($num); Array([0]=>0 [1]=>1 [5]=>5) Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5) Array([2]=>two [3]=>three [4]=>four) Array([1]=> 1) TRUE ANSWER : ? YOUR ANSWER : ?
How many functions does PHP offer for searching strings using POSIX style regular expression? 10 9 7 8 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 : ?
POSIX implementation was deprecated in which version of PHP? PHP 5 PHP 5.2 PHP 4 PHP 5.3 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([1]=> 1) Array([2]=>two [3]=>three [4]=>four) Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5) Array([0]=>0 [5]=>5) 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 not Will Pitt I am great My name is 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/>echo str_pad("Salad", 5)." is good."; is good SaladSaladSaladSaladSalad SaladSaladSaladSaladSalad is good Salad is good is good Salad TRUE ANSWER : ? YOUR ANSWER : ?