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中单引号与双引号的区别? 1. 由下可看出,双引号的变量是解析并输出,而单引号的变量不解析。 2.单引号的解析速度比双引号的快 3. 对于单引号来说,只有两个转义 \',\\ 4....

解析php中用PHPMailer来发送邮件的示例(126.com的例子)

<?phprequire_once('../class.phpmailer.php');$mail= new PHPMailer();$body= "我终于发送邮件成功了!呵呵!g...

解析PHP跳出循环的方法以及continue、break、exit的区别介绍

PHP中的循环结构大致有for循环,while循环,do{} while 循环以及foreach循环几种,不管哪种循环中,在PHP中跳出循环大致有这么几种方式:代码:复制代码 代码如下:...

php插入含有特殊符号数据的处理方法

发现问题 当我们在向mysql写入数据时,如果数据中有特殊字符就会出现数据无法正常入库的情况,比如: mysql_query(”update table set `name`='ma...

PHP中each与list用法分析

本文实例分析了PHP中each与list用法。分享给大家供大家参考,具体如下: 1.each的用法 先看API array each ( array &$array ) api里是这么描...