This article describes the use of the For loop and switch statements in the thinkphp template. Share to everyone for your reference, as follows:
1.for usage
Case
{$i}
resolves to
for ($i =1; $i <100; $i +=1) { echo $i;}
2.switch usage
Output content 1
output 2
default condition
Case
value1
value2
default
You can also use variables for the Value property of the case, for example:
admin
member
default
Comprehensive case
Default
More interested in thinkphp related content readers can view this site topic: "thinkphp Introductory Tutorial", "thinkphp Template Operation Skills Summary", "thinkphp Common Methods Summary", "CodeIgniter Getting Started Tutorial", "CI ( CodeIgniter) Framework Advanced Tutorial, Zend Framework Introduction tutorial, Smarty Template Primer Basic Tutorial and PHP template technology summary.
It is hoped that this article is helpful to the PHP program design based on thinkphp framework.