Which one of the following functions finds the last occurrence of a string, returning its numerical position? strlast() strpos() strrpos() strlastpos() TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following PHP code?<br/>$username = "jasoN";<br/>if (ereg("([^a-z])",$username))<br/>echo "Username must be all lowercase!";<br/>else<br/>echo "Username is all lowercase!"; Username is all lowercase! Username must be all lowercase! Error No Output is returned TRUE ANSWER : ? YOUR ANSWER : ?
Parameter flags was added in which version of PHP? PHP 4.1 PHP 4.2 PHP 4.0 PHP 4.3 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/>$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. ) Array ( [0] => this is [1] => some text that [2] => we might like to parse. ) [0] => this is [1] => some text that [2] => we might like to parse. 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_findre() preg_find_replace() preg_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 great My name is not Will Pitt I am great My name is not Will Pitt I am not great My name is Will Pitt I am not great TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following would be a potential match for the Perl-based regular expression /fo{2,4}/ ?<br/>1. fol<br/>2. fool<br/>3. fooool<br/>4. fooooool 1, 3 and 4 2 and 3 1 and 4 Only 1 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 is Cameron Fox. Coffee? Hello! My name was Cameron Fox. Coffee? Hello! My name is Cameron Fox. tea? 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([1]=> 1) Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5) Array([2]=>two [3]=>three [4]=>four) Array([0]=>0 [1]=>1 [5]=>5) TRUE ANSWER : ? YOUR ANSWER : ?