Home >Backend Development >PHP Tutorial >PHP smarty--smarty basics

PHP smarty--smarty basics

巴扎黑
巴扎黑Original
2016-11-24 09:23:531083browse

1. The first letter of the first sentence should be capitalized: <{$str1|capitalize}>

2. The second sentence template variable + Li Xiaojun: <{$str2|cat:"李晓君"}>

3 . The third sentence outputs the current date: <{$str3|date_format:"%Y year %m month %d day"}>

4. The fourth sentence. The php program does not process it, it displays the default value: < ;{$str4|default:"No value!"}>

5. The fifth sentence should be indented by 8 blank characters, and use "*" to replace these 8 blank characters: <{$ str5|indent:8:"*"}>

6. The sixth sentence changes all TEACHerLI@163.com to lowercase: <{$str6|lower}>

7. The seventh sentence The eighth sentence is to use variable modifiers in combination: <{$str8|capitalize |cat:"Here is the newly added time:"|date_format:"%Y year %m month %d day"|lower}>

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
Previous article:php--for/foreachNext article:php--for/foreach