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中,所有的变量都存储在"符号表"的HastTable结构中,符号的作用域是与活动符号表相关联的。因此,同一时间,只有一个活动符号表。 我们要获取到当前活动符号表可以通过 get_d...

php调用Google translate_tts api实现代码

今天用google翻译时,发现个好东西:Google translate_tts,调用这个api就可以听到英文发音,省掉了自己上传音频文件的麻烦。我用php写了个调用的方法,可以把音频文...

Thinkphp单字母函数使用指南

A方法 A方法用于在内部实例化控制器,调用格式:A(‘[项目://][分组/]模块','控制器层名称') 最简单的用法: 复制代码 代码如下: $User = A('User');...

jq的get传参数在utf-8中乱码问题的解决php版

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//E...

PHP 日期时间函数的高级应用技巧

PHP 日期时间函数的高级应用技巧

PHP的日期时间函数date() 1,年-月-日 echo date('Y-m-j'); 2007-02-6 echo date('y-n-j'); 07-2-6 大写Y表示年四...