adplus-dvertising
frame-decoration

Question

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.";
    ?>

a.

Contact the author of this article at [email protected]@mple.com

b.

[email protected]t the @uthor of this @rticle @t [email protected]@[email protected]

c.

Contact the author of this article at [email protected]@[email protected]

d.

Error

Posted under PHP

Answer: (c).Contact the author of this article at [email protected]@[email protected]

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following PHP code?

Similar Questions

Discover Related MCQs

Q. Which one of the following functions finds the last occurrence of a string, returning its numerical position?

Q. Which one of the following functions can be used to concatenate array elements to form a single delimited string?

Q. Which one of the following functions will convert a string to all uppercase?

Q. Say we have two compare two strings which of the following function/functions can you use?

i) strcmp()
ii) strcasecmp()
iii) strspn()
iv) strcspn()

Q. How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.

Q. Which among the following is/are not a metacharacter?

i) \a
ii) \A
iii) \b
iv) \B

Q. Which of the following would be a potential match for the Perl-based regular expression /fo{2,4}/ ?

i) fol
ii) fool
iii) fooool
iv) fooooool

Q. POSIX stands for

Q. POSIX implementation was deprecated in which version of PHP?

Q. How many functions does PHP offer for searching strings using POSIX style regular expression?

Q. [:alpha:] can also be specified as..

Q. Which one of the following regular expression matches any string containing zero or one p?

Q. PHP has long supported two regular expression implementations known as _______ and _______

i) Perl
ii) PEAR
iii) Pearl
iv) POSIX

Q. Operator that is used for heredoc syntax

Q. Strstr ( ) function selects a substring by its

Q. Which syntax is very useful for specifying large chunks of interpolated variable text?

Q. Which three functions has intimate relationship with each other?

Q. Function Strcmp ( ) is equals to

Q. How many operators PHP offer for strings?

Q. Dot ". " operator in strings are called as