每日一句 ( 20241222 )  

Rivers know this: there is no hurry. We shall get there some day.

河流知道這一點(diǎn):無需匆忙。我們終有一日會(huì)到達(dá)。———— A. A. Milne

對(duì)于foreach循環(huán)的一點(diǎn)小認(rèn)識(shí)

首先來看一段代碼:$arr = array("a","b","c","d");foreach($arr as $val) { echo $val.' '; $arr = array("a1","b1","c1","d1"); foreach($arr as $val) { echo $val.' '; }}這段代碼會(huì)輸出什么呢?或者來個(gè)簡(jiǎn)單的:$arr = array("a","b","c","d");foreach($arr as $val) { echo $val.' '; $arr = array();}第一段代碼會(huì)輸出”a a1 b1 c1 d1 b a1 b1 ...

學(xué)習(xí)smarty第一天

從今天開始學(xué)習(xí)smarty模板技術(shù)了,其實(shí)應(yīng)該是第二天了,昨天晚上學(xué)習(xí)smarty的基本配置。再其實(shí),以前學(xué)過,都忘了……….今天主要學(xué)習(xí)的是smarty中$smarty->assign()和$smarty->display()兩個(gè)函數(shù)的簡(jiǎn)單使用,以及簡(jiǎn)單的{section}和{foreach}循環(huán)。smarty簡(jiǎn)單配置文件:index.php:index模板文件:{foreach from=$new key=k item=v}{$k} - {$v.new_name}{/foreach}...