search

Home  >  Q&A  >  body text

Why does the first one output 1?

for loop 0<10, i 1=1, echo $num[1], isn’t the result 2?

相知相惜相知相惜2314 days ago1538

reply all(2)I'll reply

  • 城南花已开

    城南花已开2018-12-05 10:04:20

    The for loop first determines when $i=0, $int<10, then executes the statement in the for loop, which is echo $num[0], and then executes i++, and then determines when i=1, the poster will for The sequence of the cycle process is wrong

    reply
    0
  • 亲爱の偏執狂

    亲爱の偏執狂2018-09-08 16:47:46

    Start from the 0th one, 0=1

    reply
    0
  • Cancelreply