Home / CSE / PHP - CS :: Discussion

Discussion :: PHP - CS

  1. Which statement will output $x on the screen?

  2. A.

     echo “\$x”;

    B.

     echo “$$x”;

    C.

     echo “/$x”;

    D.

     echo “$x;”;

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    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.


Be The First To Comment