Loop structure of thinkphp

Source: Internet
Author: User
Loop structure. in the loop output, the variable does not need to add $ symbol instance 1.for( tableborder & amp; #39; 1 & amp; #39; width & amp; #39; 500 & amp; #39;) (forstart & amp; #39; 0 & amp; #39; end & amp; #39; 10 & amp; #39; name...

Loop structure. the $ symbol is not required for the variable in the loop output.

Instance 1.for

  1. (Table border = '1' width = '000000 ')
  2. (For start = '0' end = '10' name = 'J' step = '-2' comparison = 'GT ') // lt positive Order step is the step value plus 2/gt reverse Order output step is the step value minus 2
  3. (Tr) (td) {$ j} (/td) (td) abc (/td) (/tr)
  4. (/)
  5. (/Table)

Instance 2. volist

  1. (Volist name = 'list' id = 'V') // A circular multi-dimensional array. v indicates the current array.
  2. {$ V. username} (br /)
  3. (/Volist)

Instance 3. foreach

  1. (Foreach name = 'list' item = 'V' key = 'k ')
  2. {$ K} ------- {$ v} (br /)
  3. (/Foreach)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.