I am working with two seperate files which contain similar code - One throws a parse error for an identical line, the other does not. I do not understand why this would be.
The error on the file that will not run is: Parse error: syntax error, unexpected '2' (T_LNUMBER)
Here is a code snippet that works without the parse error:
if (($indx % 2) == 1) {$rowClass = $trOdd; } else { $rowClass = $trEven; } echo '<tr '.$rowClass.'>';
Here is a code snippet that does not work and has the parse error:
if (($indx % 2) == 1) {$rowClass = $trOdd; } else { $rowClass = $trEven; } echo '<tr '.$rowClass.'>';
Identical.
This error centers around the use of the 2, hence the (T_LNUMBER).
I see no difference in either code - I am simply doing ($indx % 2) == 1), the 2 being the problem for some reason.
Thank you in advance for any help!