易截截图软件、单文件、免安装、纯绿色、仅160KB

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


相关文档:

php是什么?

原文链接:http://www.phpdo.net/index.php/2010/01/25/29/
学习了一段时间PHP,觉得有点收获。也应该将学过的东西拿出来晒晒了,不然就交回给课本了。
PHP是什么呢?
PHP,是超级文本预处理语言(PHP:Hypertext Preprocessor)的缩写。PHP 是一种 HTML 内嵌式的语言,是一种在服务器端执行的嵌入HTML文档的脚本语言,语 ......

php中utf 8编码下用正则表达式如何匹配汉字

需要用的php的正规匹配汉字,在网上找了些文章看了以下,看到这个的时候感觉这篇文章写的很真实,忍不住转过来了。
原文地址:http://hi.baidu.com/comdeng/blog/item/f272362e47ce29564ec226c5.html
在javascript中,要判断字符串是中文是很简单的。比如:
var str = "php编程";
if (/^[\u4e00-\u9fa5]+$/.t ......

php常用的基本函数

php的函数分为系统函数,用户函数
1,php函数不区分大小写
函数原型:
 返回类型 函数名称(类型 参数)
2.1,系统函数中常用的数学函数
abs(eumber) 去绝对值
sin(float)  正弦计算sin(x)
cos(float) 余弦计算cos(x)
log(float) 自然对数计算
sqrt(float) 开平方根计算
log10(float) 10基底的对数
ex ......

简介两款PHP开发的开源的在线办公软件

    诸如 Google Doc 等Web应用,允许通过互联网共享信息进行协同工作,给我们带来了全新的日常办公体验。随着大量的桌面应用被移植到 Web 环境,无论是纯粹的 HTML+CSS+JS 或者 RIA 都将更受追捧。
    以下是两款开放源代码的 Web 办公软件:
    1. OpenGoo
 &nbs ......

Smarty 模板 从php分配的变量

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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号