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实现遍历多维数组的方法

本文实例讲述了php实现遍历多维数组的方法。分享给大家供大家参考,具体如下: $a=array('fruits'=>array('a'=>'orange','b'=>...

php 根据自增id创建唯一编号类

在开发过程中,我们数据表一般都使用自增数字作为id主键,而id是数字型,不容易理解。我们把id按一定格式转为编号后,很容易根据编号知道代表的是什么内容。 例如订单表id=20160111...

全面解读PHP的人气开发框架Laravel

Laravel的主要技术特点: 1、Bundle是Laravel的扩展包组织形式或称呼。Laravel的扩展包仓库已经相当成熟了,可以很容易的帮你把扩展包(bundle)安装到你的应用中...

php中字符集转换iconv函数使用总结

iconv函数库能够完成各种字符集间的转换,是php编程中不可缺少的基础函数库。 用法如下: 复制代码 代码如下: $string = "欢迎访问【宜配屋www.yipeiwu.com】...

php中将一段数据存到一个txt文件中并显示其内容

这里的数据可以为基本数据类型,数组,对象等; 在存储的时候可以用serialize进行序列化,但取的时候要先用unserialize反序列化。 <?php $dat...