I have the following code which is part of a for loop. There are 2 arrays previously defined ($var, $bar):
[php]echo ( "<tr><td><i nput name=\"".$var[$i]."_guild_upgrad e\" type=\"submit\" value=\"Level ".++$bar[$i]."\" /></td></tr>" ) ;[/php]
That works 100%. However that is not what I tired first. I was tring to do this:
[php]echo ( "<tr><td><i nput name=\"".$var[$i]."_guild_upgrad e\" type=\"submit\" value=\"Level ".$bar[$i]+1."\" /></td></tr>" ) ;[/php]
This was coming up with a parse error: syntax error, unexpected T_CONSTANT_ENCA PSED_STRING?
Does anyone know why I can't use +1 instead of ++?
[php]echo ( "<tr><td><i nput name=\"".$var[$i]."_guild_upgrad e\" type=\"submit\" value=\"Level ".++$bar[$i]."\" /></td></tr>" ) ;[/php]
That works 100%. However that is not what I tired first. I was tring to do this:
[php]echo ( "<tr><td><i nput name=\"".$var[$i]."_guild_upgrad e\" type=\"submit\" value=\"Level ".$bar[$i]+1."\" /></td></tr>" ) ;[/php]
This was coming up with a parse error: syntax error, unexpected T_CONSTANT_ENCA PSED_STRING?
Does anyone know why I can't use +1 instead of ++?
Comment