What will be the output of the following PHP code?
<?php
$author = "nachiketh@example.com";
$author = str_replace("a","@",$author);
echo "Contact the author of this article at $author.";
?>
<?php
$author = "nachiketh@example.com";
$author = str_replace("a","@",$author);
echo "Contact the author of this article at $author.";
?>
A. Contact the author of this article at nachiketh@ex@mple.com
B. Cont@ct the @uthor of this @rticle @t n@chiketh@ex@mple.com
C. Contact the author of this article at n@chiketh@ex@mple.com
D. Error
Answer: Option C
Solution(By Examveda Team)
The str_replace() function case sensitively replaces all instances of a string with another.Related Questions on Regular Expressions
A. 1 and 2
B. 2 and 4
C. 1 and 4
D. 2 and 3
Join The Discussion