Sail E0 Webinar
Question
What will be the output of the following PHP code?
< ?php
$num = 10;
echo 'What is her age? \n She is $num years old';
?>
Options:
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: Option A


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



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers