smarty静态实验表明,网络上是错的~呵呵

yipeiwu_com6年前PHP代码库

复制代码 代码如下:
<? 
 require_once("Smarty/libs/Smarty.class.php"); 
 $smarty = new smarty(); 
 $smarty->templates_dir="templates"; 
 $smarty->templates_c_dir="templates_c"; 
 $smarty->left_delimiter="<{"; 
 $smarty->right_delimiter="}>"; 
 $smarty->assign("title","你成功了"); 
 $smarty->display("test.html"); 
 $content=$smarty->fetch("test.html"); 
 $fp=fopen("ok.html","w"); 
 fwrite($fp,$content); 
 fclose($fp); 
?>

相关文章

php用户注册信息验证正则表达式

下面这个正则验证用户名的方法原则是这样的用户名必须是由字母带数字带定划线组成了,下面一起来看看例子吧. 1.检查用户名是否符合规定“两位以上的字母,数字,或者下划线”,代码如下: /...

jQuery中的RadioButton,input,CheckBox取值赋值实现代码

1、jquery 获取单选组radio$("input[name='name']:checked").val(); 2、jquery获取radiobutton的下一个值$("input[...

PHP入门教程之字符串处理技巧总结(转换,过滤,解析,查找,截取,替换等)

本文实例总结了PHP字符串处理技巧。分享给大家供大家参考,具体如下: Demo1.php <?php //源代码是文本形式,页面显示是 web 形式 $str...

php通过sort()函数给数组排序的方法

本文实例讲述了php通过sort()函数给数组排序的方法。分享给大家供大家参考。具体分析如下: sort()函数用于给数组排序,本函数为数组中的单元赋予新的键名。原有的键名将被删除。...

PHP面向接口编程 耦合设计模式 简单范例

复制代码 代码如下: <?php interface js{ function ys($a,$b); } class Af implements js{ function ys($...