Which of the following is a valid PHP variable name?
-
A
$var_name
Correct answer
-
B
$var-name
-
C
$123var
-
D
$var name
Correct answer
A. $var_name
17 views
Explanation
PHP variables must start with a $ sign, followed by a letter or underscore.
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ