cycle for counter +10



  • There's a cycle.

    for ($i=0; $i < 50; $i+10) {
        echo "$i </br>";
    }
    

    There's a cycling, because $ not increasing by 10.

    If put $i++ It works.

    Can we use increment and decrement in the cycle?



  • Right, why should it increase? You want to change the variable, change it as planned: $i += 10♪ Incremental operator characteristics ++ The fact that he changes the variable itself and is almost similar to the records. $i += 1(For a distinction in terms, see postincrement and pre-increment).


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2