Home » PHP » PHP Introduction » Question
  1. What will be the output of the following PHP code?
    $n = 18;
    echo 'What is her age? \n She is $n years old.';
    ?>
    1. Error
    2. What is her age? \n She is 18 years old
    3. What is her age? \n She is $n years old.
    4. 18
    5. None of these
Correct Option: C

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



Your comments will be displayed only after manual approval.