Pain.php 復制代碼 代碼如下: <?php class Pain { public $var=array(); public $tpl=array(); //this is the method to assign vars to the template public function assign($variable,$value=null) { $ " /> 青青草久久,色欲国产麻豆精品AV免费,久久人人玩人妻潮喷内射人人

天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

Pain 全世界最小最簡單的PHP模板引擎 (普通版)

打包下載

Pain.php
復制代碼 代碼如下:
<?php
class Pain
{
public $var=array();
public $tpl=array();
//this is the method to assign vars to the template
public function assign($variable,$value=null)
{
$this->var[$variable]=$value;
}
public function display($template_name,$return_string=false)
{
//first find whether the tmp file in tmp dir exists.
if(file_exists("tmp/temp_file.php"))
{
unlink("tmp/temp_file.php");
}
extract($this->var);
$tpl_content=file_get_contents($template_name);
$tpl_content=str_replace("{@", "<?php echo ", $tpl_content);
$tpl_content=str_replace("@}", " ?>", $tpl_content);
//create a file in the /tmp dir and put the $tpl_contentn into it, then
//use 'include' method to load it!
$tmp_file_name="temp_file.php";
//$tmp is the handler
$tmp=fopen("tmp/".$tmp_file_name, "w");
fwrite($tmp, $tpl_content);
include "tmp/".$tmp_file_name;
}
}
?>

test.php
復制代碼 代碼如下:
<?php
require_once "Pain.php";
$pain=new Pain();
$songyu="songyu nb";
$zhangyuan="zhangyuan sb";
$pain->assign("songyu",$songyu);
$pain->assign("zhangyuan",$zhangyuan);
$pain->display("new_file.html");
?>

new_file.html
復制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>new_file</title>
</head>
<body>
{@$songyu@}<br/>
{@$zhangyuan@}
</body>
</html>

php技術Pain 全世界最小最簡單的PHP模板引擎 (普通版),轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 99精品免费久久久久久久久蜜桃 | 国产精品久免费的黄网站 | 国产精品97久久久久久AV色戒 | 免费久久狼人香蕉网 | 91香蕉福利一区二区三区 | 9国产露脸精品国产麻豆 | 在线观看国产区 | 和姐姐做插得很深 | 做i爱视频30分钟免费 | 女人高潮特级毛片 | 国产偷国产偷亚洲高清SWAG | 久久有码中文字幕 | 老太婆性BBWBBW | 91黄色影院 | 免费观看成人毛片 | 中国老太婆xxxxx | Y8848高清私人影院软件优势 | 人人澡人人爽人人精品 | 天天色天天综合网 | 国产欧美二区综合 | 男生射女生 | 人淫阁| 亚洲性无码av在线 | 99九九99九九九视频精品 | 亚洲色图另类小说 | 97伦理97伦理2018最新 | 男生在床上脱美女 胸 | 杨幂视频在线观看1分30秒 | 国产在线视频在线观看 | 国产精品一区二区三区四区五区 | 午夜国产在线观看 | 草莓视频免费在线观看 | 亚洲高清无在码在线电影 | 国产乱码免费卡1卡二卡3卡四卡 | 忘忧草日本在线社区WWW电影 | 日本黄 色大片全 | 扒开双腿疯进出爽爽爽动态图 | 国产最新精品亚洲2021不卡 | 特级毛片全部免费播放免下载 | 成人免费一级毛片在线播放视频 | 午夜AV亚洲一码二中文字幕青青 |