php smarty±äÁ¿µÄÐÞÊÎ
test.php´úÂ룺 view plaincopy to clipboardprint?
assign("total",$total); //¶ÔÄ£°æÖеıäÁ¿¸³Öµ $formatted_total = number_format($total); //¸ñʽ»¯$total $smarty->assign("formatted_total",$formatted_total); //¶ÔÄ£°æÖеıäÁ¿¸³Öµ $smarty->display('test1.htm'); //ÏÔÊ¾Ò³Ãæ ?>
assign("total",$total); //¶ÔÄ£°æÖеıäÁ¿¸³Öµ $formatted_total = number_format($total); //¸ñʽ»¯$total $smarty->assign("formatted_total",$formatted_total); //¶ÔÄ£°æÖеıäÁ¿¸³Öµ $smarty->display('test1.htm'); //ÏÔÊ¾Ò³Ãæ ?> test1.htmlÄ£°å´úÂ룺 view plaincopy to clipboardprint?
Total is {$total}
Formatted Total is {$formatted_total}
Total is {$total}
Formatted Total is {$formatted_total}
±àÒëºóµÄtest.html.php´úÂ룺 view plaincopy to clipboardprint?
Total is _tpl_vars['total']; ?>
Formatted Total is _tpl_vars['formatted_total']; ?>
Total is _tpl_vars['total']; ?>
Formatted Total is _tpl_vars['formatted_total']; ?>
test1.htmlÄ£°å¿ÉÒÔ¸Äд³ÉÕâÑùtest2.html£º view plaincopy to clipboardprint?
Total is {$total}
Formatted Total is {$total|number_format}
Total is {$total}
Formatted Total is {$total|number_format}
ÔòÏàÓ¦µÄtest.php´úÂë¸ÄΪ£º view plaincopy to clipboardprint?
assign("total",$total); //¶ÔÄ£°æÖеıäÁ¿¸³Öµ $smarty->display('test2.htm'); //ÏÔÊ¾Ò³Ãæ ?>
assign("total",$total); //¶ÔÄ£°æÖеıäÁ¿¸³Öµ $smarty->display('test2.htm'); //ÏÔÊ¾Ò³Ãæ ?> ä¯ÀÀÆ÷ÏÔʾ£º Total is 12345 Formatted Total is 12,345 ±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/zhuzhao/archive/2009/03/19/4006030.aspx ±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/zhuzhao/archive/2009/03/19/4006030.aspx
Ïà¹ØÎĵµ£º
這個問題ÓÐ點Ææ¹Ö£¬ÔÚJavaºÍ.netµÄÊÀ½ç裡還δÅöµ½過.......
¿´來PHP對對ÏóµÄÖ§³Ö還²»ÊÇÌ«ÓѺ㬺ǺÇ~~~
[轉載ì¶£º] http://blog.csdn.net/yehell/archive/2007/12/19/1953826.aspx
½ñÌìÔÚphpÎļþÖÐÉèÖÃÁËÒ»¸ösession.²¢½«Ò»¸öÀ ......
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/2010/01/25/29/
ѧϰÁËÒ»¶Îʱ¼äPHP£¬¾õµÃÓеãÊÕ»ñ¡£Ò²Ó¦¸Ã½«Ñ§¹ýµÄ¶«Î÷ÄóöÀ´É¹É¹ÁË£¬²»È»¾Í½»»Ø¸ø¿Î±¾ÁË¡£
PHPÊÇÊ²Ã´ÄØ£¿
PHP£¬Êdz¬¼¶Îı¾Ô¤´¦ÀíÓïÑÔ£¨PHP:Hypertext Preprocessor£©µÄËõд¡£PHP ÊÇÒ»ÖÖ HTML ÄÚǶʽµÄÓïÑÔ£¬ÊÇÒ»ÖÖÔÚ·þÎñÆ÷¶ËÖ´ÐеÄǶÈëHTMLÎĵµµÄ½Å±¾ÓïÑÔ£¬Óï ......
ÐèÒªÓõÄphpµÄÕý¹æÆ¥Å人×Ö£¬ÔÚÍøÉÏÕÒÁËЩÎÄÕ¿´ÁËÒÔÏ£¬¿´µ½Õâ¸öµÄʱºò¸Ð¾õÕâÆªÎÄÕÂдµÄºÜÕæÊµ£¬È̲»×¡×ª¹ýÀ´ÁË¡£
ÔÎĵØÖ·£ºhttp://hi.baidu.com/comdeng/blog/item/f272362e47ce29564ec226c5.html
ÔÚjavascriptÖУ¬ÒªÅжÏ×Ö·û´®ÊÇÖÐÎÄÊǺܼòµ¥µÄ¡£±ÈÈ磺
var str = "php±à³Ì";
if (/^[\u4e00-\u9fa5]+$/.t ......
index.php:
$smarty = new Smarty;
$smarty->assign('Contacts',
array('555-222-9876',
'zaphod@slartibartfast.com',
array('555-444-3333',
'555-111-1234')));
$smarty->display('index.tpl');
index.tpl:
{$Contacts[0]}<br>
{$Contacts[1]}<br>
{* you can print arrays of arrays ......
index.php:
$smarty = new Smarty;
$smarty->assign('Contacts',
array('555-222-9876',
'zaphod@slartibartfast.com',
array('555-444-3333',
'555-111-1234')));
$smarty->display('index.tpl');
index.tpl:
{$Contacts[0]}<br>
{$Contacts[1]}<br>
{* you can print arrays of arrays ......