Home » PHP » PHP Introduction » Question
  1. Which statement will output $x on the screen?
    1. echo “$x;”;
    2. echo “/$x”;
    3. echo “$$x”;
    4. echo “\$x”;
    5. None of these
Correct Option: D

A backslash is used so that the dollar sign is treated as a normal string character rather than prompt PHP to treat $x as a variable. The backslash used in this manner is known as escape character.



Your comments will be displayed only after manual approval.