???? ?? ?? ??? PHP ??? ??, ?? ??, Pain
Jul 29, 2016 am 08:47 AM
file
gt
lt
php
tmp
打包下載
Pain.php
復(fù)代碼 代碼如下:
class Pain
{
?? $var=array();
?? $tpl=array();
//???? var? ???? ?????.
?? ?? ??($variable,$value=null)
{
$this->var[$variable]=$value ;
}
public function display($template_name,$return_string=false)
{
//?? tmp dir? tmp ??? ??? ?????.
if(file_exists("tmp/temp_file.php"))
{
unlink("tmp/temp_file.php");
}
extract($this->var);
$tpl_c
$tpl_c "$tpl_c " ?>", $tpl_content);
///tmp ????? ??? ???? $tpl_contentn? ? ?? ?? ??
//'include' ???? ???? ?????!
$tmp_file_name="temp_file.php";
//$tmp? ??????.
$tmp=fopen("tmp/".$tmp_file_name, "w");
fwrite($tmp, $tpl_content);
"tmp/".$tmp_file_name ??;
}
}
?>
test.php
復(fù)代碼 代碼如下:
require_once "Pain.php";
$pain=new ??();
$s>復(fù)system代碼 代碼如下:
"http://www.w3.org/TR/html4/strict.dtd">
?>
?>
{@$songyu@}
{@$zhangyuan@}