The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End unexpected T_LNUMBER, expecting T_VARIABLE or ‘$’ Re: unexpected T_LNUMBER, expecting T_VARIABLE or ‘$’


> `$1`

You can’t have variable names that start with digits in PHP.

A suggestion: read the error messages, look at the file/ line number it describes, and see what’s wrong. With parse errors, PHP’s error messages are actually very useful, and almost always lead directly to the problem.

In this case, you wrote `$1` instead of `$i`, so PHP was confused because `1` cannot follow `$` – only identifiers (for a [variable name]( or another `$` (for [variable variables](

You can also google simple error messages like this to get a good idea of what the problem might be.