Which one of the following preg PHP function is used to do a find and replace on a string or an array? preg_findre() preg_find_replace() preg_find() preg_replace() TRUE ANSWER : ? YOUR ANSWER : ?
Parameter flags was added in which version of PHP? PHP 4.3 PHP 4.2 PHP 4.1 PHP 4.0 TRUE ANSWER : ? YOUR ANSWER : ?
Which one of the following functions is used to search a string? preg_match preg_find preg_search preg_found 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 Only 1 1 and 3 2 and 4 2, 3 and 4 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() None of the mentioned All of the mentioned 1 and 2 3 and 4 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_unchain() preg_divide() preg_destroy() preg_split() TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>echo str_pad("Salad", 5)." is good."; is good Salad Salad is good is good SaladSaladSaladSaladSalad SaladSaladSaladSaladSalad is good 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/>$line = "You like dogs. I hate dogs. We should marry."<br/>$sen = preg_split('/./', $line);<br/>print_r($sen); Array([0]=>You like dogs. I hate dogs. We should marry.) You like dogs. I hate dogs. We should marry. Array([0]=>You like dogs. [1]=>I hate dogs. [2]=>We should marry.) Error 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 : ?