Home>Article>Backend Development> Detailed explanation of the usage of for loop and switch statement in thinkPHP template

Detailed explanation of the usage of for loop and switch statement in thinkPHP template

墨辰丷
墨辰丷 Original
2018-05-30 09:55:51 3109browse

This article mainly introduces the usage of for loop and switch statement in thinkPHP template, and analyzes the specific functions, definitions and specific usage techniques of for loop and switch statement in the form of examples. Friends in need can refer to it

1.for usage


##

 


Case


 {$i} 


resolves to


for ($i=1;$i<100;$i+=1){ echo $i; }


##2.switch usage

 输出内容1 输出内容2 默认情况 


Case

 value1 value2 default 


You can also use variables for the value attribute of the case, for example:

 admin member default 


Comprehensive case

      default  



The above is the entire content of this article, I hope it will be helpful to everyone’s study .


Related recommendations:

phpDetailed explanation of security configuration records and common errors

PHP implements the method of obtaining the current date and the day of the month this Monday is


str_pad() function in phpDetailed explanation of usage


The above is the detailed content of Detailed explanation of the usage of for loop and switch statement in thinkPHP template. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn