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连接Access数据库错误及解决方法

php+access连接数据库常用的方式一般有两种.推荐的代码需要注意php获取路径用的是realpath 复制代码 代码如下: <?php $connstr="DRIVER={M...

php递归创建目录的方法

本文实例讲述了php递归创建目录的方法,分享给大家供大家参考。 具体实现代码如下: <?php function mk_dir($path){ //第1种情况,该目录...

php中current、next与reset函数用法实例

本文实例讲述了php中current、next与reset函数用法。分享给大家供大家参考。 具体代码如下: 复制代码 代码如下:$array=array('step one','step...

php输出表格的实现代码(修正版)

网上的代码很多都是错误的,【宜配屋www.yipeiwu.com】特修正了下。复制代码 代码如下:<html> <head> <title>二行5列一...

PHP5 面向对象程序设计

PHP5有一个单重继承的,限制访问的,可以重载的对象模型. 本章稍后会详细讨论的”继承”,包含类间的父-子关系. 另外,PHP支持对属性和方法的限制性访问. ...