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 7的一些引人注目的新特性简单介绍

1. ?? 运算符(NULL 合并运算符) 把这个放在第一个说是因为我觉得它很有用。用法: $a = $_GET['a'] ?? 1; 它相当于:...

分享一则PHP定义函数代码

先贴代码 复制代码 代码如下: <?php     function table(){     &nb...

PHP判断两个给定日期是否在同一周的方法

本文实例讲述了PHP判断两个给定日期是否在同一周的方法。分享给大家供大家参考,具体如下: /** * 判断两日期是不是同一周 * 星期是按周日到周六 */ function getS...

PHP单元测试利器 PHPUNIT深入用法(二)第1/2页

PHP单元测试利器 PHPUNIT深入用法(二)第1/2页

1、markTestSkipped和markTestIncomplete   在phpunit中,有两个有用的方法markTestSkipped和markTestIncomplete。...

PHP 读取和修改大文件的某行内容的代码

复制代码 代码如下: $fp = fopen('d:/file.txt', 'r+'); if ($fp) { $i = 1; while (!feof($fp)) { //修改第二行数...