The line PHP doesn't like is the for loop but I can't think of another way to limit the content. How do I fix this?
1 Year Ago
Related Article:syntax error - unexpected T_variable
is a solved PHP discussion thread by salii that has 10 replies, was last updated 1 year ago and has been tagged with the keywords: php, syntax, error.
I know that the message at the bottom of this page says to let old threads die but I just had to post a reply to this thread.
First off the issue, bsewell, that you're having here is a simple syntax error. You for loop:
should be this:
Notice the $ on your iterator.
I find it interesting how PHP (and other languages) report their errors in the most cryptic and unmeaningful fashion. T_INC? It seems that a straight up i in a for loop's iterator (or step) is called a T_INC. I can only assume that INC stands for INCREMENT which would make sense, but how'bout this one:
T_PAAMAYIM_NEKUDOTAYIM < What the...?
Turns out that's hebrew for "twice colon" or "double colon". It's an error that you'll encounter while using the scope resolution operator. Doesn't it make you sit there and scratch your head while asking yourself why? Some of these errors might as well say "unexpected T_FINGER_POPPIN_GOOD_TIME". Well, at least it points you to the proper line.