PHP Regular Expressions
What will be the output of the following PHP code?
$foods = array("pasta", "steak", "fish", "potatoes");
$food = preg_grep("/^s/", $foods);
print_r($food);

Array ( [3] => potatoes )
Array ( [0] => pasta [1] => steak [2] => fish [3] => potatoes )
Array ( [0] => potatoes )
Array ( [1] => steak )

ANSWER DOWNLOAD EXAMIANS APP

PHP Regular Expressions
What will be the output of the following PHP code?
$text = "this istsome text thatnwe might like to parse.";
print_r(split("[nt]",$text));

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.
this is some text that we might like to parse.

ANSWER DOWNLOAD EXAMIANS APP

PHP Regular Expressions
What will be the output of the following PHP code?
$author = "nachiketh@example.com";
$author = str_replace("a","@",$author);
echo "Contact the author of this article at $author.";

Error
Contact the author of this article at n@chiketh@ex@mple.com
Contact the author of this article at nachiketh@ex@mple.com
Cont@ct the @uthor of this @rticle @t n@chiketh@ex@mple.com

ANSWER DOWNLOAD EXAMIANS APP