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/>$foods = array("pasta", "steak", "fish", "potatoes");<br/>$food = preg_grep("/^s/", $foods);<br/>print_r($food); Array ( [3] => potatoes ) Array ( [1] => steak ) Array ( [0] => potatoes ) Array ( [0] => pasta [1] => steak [2] => fish [3] => potatoes ) 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)); Array ( [0] => this is [1] => some text that [2] => 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. this is some text that we might like to parse. TRUE ANSWER : ? YOUR ANSWER : ?
How many functions does PHP offer for searching strings using POSIX style regular expression? 8 10 9 7 TRUE ANSWER : ? YOUR ANSWER : ?
Say we have two compare two strings which of the following function/functions can you use?<br/>1. strcmp()<br/>2. strcasecmp()<br/>3. strspn()<br/>4. strcspn() All of the mentioned 3 and 4 None of the mentioned 1 and 2 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([0]=>0 [5]=>5) Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5) Array([2]=>two [3]=>three [4]=>four) 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 not Will Pitt I am great My name is Will Pitt I am not great My name is Will Pitt I am great TRUE ANSWER : ? YOUR ANSWER : ?
Which among the following is/are not a metacharacter?<br/>1. /a<br/>2. /A<br/>3. /b<br/>4. /B 2, 3 and 4 2 and 4 Only 1 1 and 3 TRUE ANSWER : ? YOUR ANSWER : ?
Which one of the following functions will convert a string to all uppercase? uppercase() str_uppercase() strtoupper() struppercase() TRUE ANSWER : ? YOUR ANSWER : ?
Which one of the following functions is used to search a string? preg_search preg_match preg_find preg_found TRUE ANSWER : ? YOUR ANSWER : ?