A

Admin • 833K Points
Coach

Q. What is the result of the following PHP code?

Code:
<?php
$mail = "admin@example.com";
$mail = str_replace("a","@",$mail);
echo "Contact me at $mail.";
?>
  • (A) Contact me at @dmin@ex@mple.com.
  • (B) Contact me at admin@example.com.
  • (C) Contact me at adminaexample.com.
  • (D) Contact me at $mail.
  • Correct Answer - Option(A)
  • Views: 26
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

The built-in function The str_replace() replaces some characters with other characters in a string.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.