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 CURL模拟GET及POST函数代码

复制代码 代码如下:<?php function vcurl($url, $post = '', $cookie = '', $cookiejar = '', $referer =...

php判断访问IP的方法

本文实例讲述了php判断访问IP的方法。分享给大家供大家参考。具体如下: <?php function getIP() { if (! empty ( $_SE...

php设计模式 Chain Of Responsibility (职责链模式)

复制代码 代码如下: <?php /** * 职责链模式 * * 为解除请求的发送者和接收者之间的耦合,而使用多个对象都用机会处理这个请求,将这些对象连成一条链,并沿着这条链传递该...

PHP封装的非对称加密RSA算法示例

本文实例讲述了PHP封装的非对称加密RSA算法。分享给大家供大家参考,具体如下: 将php的openssl扩展中的非对称加密函数封装成一个Rsa类。 需要注意的是,在windows上,需...

php var_export与var_dump 输出的不同

问题发现在跟踪yratings_get_targets的时候,error_log(var_export(yblog_mspconfiginit("ratings"),true));老是打...