53.8k views
2 votes
Which of the following is not a valid PHP variable:

a. $_tenth,
b. $Tenth,
c. $10th,
d. $tENTH
Why is it not valid?

User Gemmo
by
5.8k points

1 Answer

4 votes

Answer:

c. $10th

Step-by-step explanation:

In order to declare or create a valid variable in PHP, there are rules and guidelines to follow, these the following:

1. Valid variable begins with the $ sign.

2. It must begin with a letter or the underscore character only.

3. Valid variable cannot begin with a number after the $ dollar sign.

4. It can only contain alpha-numeric characters and underscores

5. Valid variable name is case-sensitive

Hence, given these rules and guidelines, the correct answer is option C, which after starting with $ sign begins with a number character.

User Genco
by
5.6k points