I have too variables 1 called $image_error_0 (zero with increment as it is added while in a loop.
I am using this var in a view of mine , that creates a form, I need to print that var out to the user if it isset, however as it in a loop, I need to print as recurring number,
I have tried doing the the following, $image_error_.$i thinking that this would work, however I just get the following error,
[Fri Oct 28 08:34:49 2011] [error] [client 127.0.0.1] PHP Parse error: syntax error, unexpected '.', expecting ',' or ')'
How can I make it so that the number of on the $image_error var incremenets with each loop in my view?
The only chance to do that would be something like
eval('$image_error_' . $i), which is a pretty bad idea. You really should consider using an array for what you want to do. Maybe something like this:If that’s sort of what you want to have.