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); 
?>

相关文章

c#中的实现php中的preg_replace

把php preg_replace 用c# 重写了一下。 PHP语言的功能非常强大,主要就是靠它强大的函数来作支撑。我们在这篇文章中将会为大家详细讲解有关PHP函数preg_replac...

无JS,完全php面向过程数据分页实现代码

复制代码 代码如下: <?php //登陆页面设置的session,当session中存在name时 //session_start(); //$name = $_SESSION[...

php中count获取多维数组长度的方法

本文实例讲述了php中count获取多维数组长度的实现方法。分享给大家供大家参考。具体分析如下: 先来看看下面程序运行结果: 复制代码 代码如下:$numb=array(  ...

让的PHP代码飞起来的40条小技巧(提升php效率)

1.如果一个方法能被静态,那就声明他为静态的,速度可提高1/4; 2.echo的效率高于print,因为echo没有返回值,print返回一个整型; 3.在循环之前设置循环的最大次数,而...

php flush无效,IIS7下php实时输出的方法

在一个比较费时的操作中,想把操作记录在浏览器上实时显示出来,用到了flush(),把缓冲中的内容发送到浏览器。但在iis7里面用fastcgi模式配置的php怎么都实现不了,结果总是一起...