search

Home  >  Q&A  >  body text

Problems in volist

When offset="2" in volist in the video, why does the output start from 1 when key="$k"? ?

!2390 days ago1287

reply all(3)I'll reply

  • 无忌哥哥

    无忌哥哥2018-06-14 10:57:14

    The first index of the array is 0, and the second index is 1

    reply
    0
  • !

    Then why does the output start from 2 when the key is not set, that is, the default is $key? Shouldn’t the second one be 1?

    · 2018-06-14 21:04:22
    其铭

    My understanding: When the $key attribute is not set, it starts with array index 0 by default, and offset represents the array index; once $key is customized, the array index and offset are invalid, and the ordering is based on realistic concepts. Counting always starts from 1

    其铭 · 2020-06-04 10:44:20
  • Cancelreply