The $imax inside your for loop is different from the $imax outside it (as you've declared it with my inside the for loop). Remove that my. | [reply] [Watch: Dir/Any] [d/l] [select] |
Please see my edited code above
Please have a look at How do I change/delete my post?, in particular, "It is uncool to update a node in a way that renders replies confusing or meaningless". But luckily I still had your original code sitting around:
Other than that, Paladin has already pointed out the issue with the second my declaration inside the loop in your updated code. I just wanted to add that in general, one should not combine my with an if statement modifier, as its behavior is undefined (see Statement Modifiers).
| [reply] [Watch: Dir/Any] [d/l] [select] |