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

yipeiwu_com5年前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实现git部署的方法教程

背景 在小站点上,直接用git来部署php代码相当方便,你的远程站点以及本地版本库都有一个版本控制,追踪问题或者回滚是很轻松的事情。 因为在小公司上班,原先的系统还在使用传统的ftp上...

PHP编程过程中需要了解的this,self,parent的区别

{一}PHP中this,self,parent的区别之一this篇 面向对象编程(OOP,Object Oriented Programming)现已经成为编程人员的一项基本技能。利用O...

Php中文件下载功能实现超详细流程分析

Php中文件下载功能实现超详细流程分析

客户端从服务端下载文件的流程分析: 浏览器发送一个请求,请求访问服务器中的某个网页(如:down.php),该网页的代码如下。 服务器接受到该请求以后,马上运行该down.php文件 运...

PHP简单读取xml文件的方法示例

本文实例讲述了PHP简单读取xml文件的方法。分享给大家供大家参考,具体如下: 我将软件版本更新中的版本号等数据信息存放在xml文件中,使用时将版本信息读取出来。 xml文件内容如下:...

PHP操作xml代码

复制代码 代码如下:/*获取图片新闻列表*/ function getPicNews($number=5){ require_once 'include/content_class.ph...