Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following PHP code?
<?php
$num = 10;
echo ‘What is her age? \n She is $num years old’;
?>

What will be the output of the following PHP code?
<?php
$num = 10;
echo ‘What is her age? \n She is $num years old’;
?>
a) What is her age? \n She is $num years old
b) What is her age?
She is $num years old
c) What is her age? She is 10 years old
d) What is her age?
She is 10 years old

Answer: a
Explanation: When a string is enclosed within single quotes both variables and escape sequences will not be interpreted when the string is parsed.

Join The Discussion