Examveda
Examveda

Which statement will output $x on the screen?

A. echo “\$x”;

B. echo “$$x”;

C. echo “/$x”;

D. echo “$x;”;

Answer: Option A

Solution(By Examveda Team)

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.

Join The Discussion

Related Questions on Basic PHP

strval()

A. Accepts a value and converts it into a string array

B. Accepts a value and converts it into an string dictionary

C. Accepts a value and converts it into string equivalent

D. None of above