Skip to content
Advertisement

increment value of i is not working properly

I am not able to understand why value of i is not setting to zero and it’s behaving like this st the start of both form value of i is set to zero but not getting the desired out in html form

JavaScript

output is showing as

JavaScript

result i want should be something like

JavaScript

Advertisement

Answer

First it should be <?php $i = 0; ?>. Notice the semicolon. Second, you need to move the increment inside the if condition, so it would look like-

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement