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 usort 使用用户自定义的比较函数对二维数组中的值进行排序

今天发现一个很好用二维数组排序的php方法,usort,推荐给大家,以后二维数组里面,要按照一个字段的值排序用这个方法简单高效,例如下面的数组: [guess_subject] =&...

PHP通过引用传递参数用法分析

本文实例讲述了PHP通过引用传递参数用法。分享给大家供大家参考,具体如下: 先看一个手册上的示例: <?php function add_some_extra(&$st...

php在页面中调用fckeditor编辑器的方法

刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的! 复制代码 代码如下: PHP页面: /* 编辑器 */ include_once "../include/fcked...

PHP基于imap获取邮件实例

本文实例讲述了PHP基于imap获取邮件的方法。分享给大家供大家参考。具体实现方法如下: imap是一款邮件交互访问的协议了,下面是实例主要利用php imap模块来快速获取邮件,列出所...

php 强制下载文件实现代码

复制代码 代码如下:<?php $file = 'monkey.gif'; if (file_exists($file)) {     header(...