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如何将XML转成数组

如果你使用 curl 获取的 xml data xml=simplexmlloadstring(data); data[′tk′]=jsondecode(jsonencode(xml),...

PHP pear安装配置教程

什么是PEAR? PEAR是PHP扩展与应用库(the PHP Extension and Application Repository)的缩写。它是一个PHP扩展及应用的一个代码仓库,...

PHP定时任务延缓执行的实现

复制代码 代码如下: /* |--------------------------- |PHP定时任务 |@黑眼诗人 <www.chenwei.ws> |----------...

PHP二维数组实现去除重复项的方法【保留各个键值】

本文实例讲述了PHP二维数组实现去除重复项的方法。分享给大家供大家参考,具体如下: 对于如下二维数组,要求对其进行去重: $arr = array( '0'=>arr...

php实现字符串翻转的方法

本文实例讲述了php实现字符串翻转的方法。分享给大家供大家参考。具体实现方法如下: <?php header("content-type:text/html;chars...