首页 新闻 会员 周边

看不怎么懂!求解释、、

0
悬赏园豆:5 [已关闭问题] 关闭于 2012-03-17 12:01

<?php
//调用格式 Template([模板-路径])
/*读带替换标记的模板函数*/

function TemplateNew($TemplateName,$begin,$end)
{
    //模板载入数组
    $FileRow=File("$TemplateName");
    For($I=0;$I<count($FileRow);$I++)
    {
        //判断条件是否符合,如果符合条件将模板读入变量
        if(eregi("$begin",$FileRow[$I-1],$Head)!="")
        {
            $Begin=1;
        }
        if($Begin==1)
        {
            $TempBuffer.=$FileRow[$I];
        }
        else
        {
            //如果还没有遇到begin 变量AllTempBuffer除网页begin与end中间部分没有
            $AllTempBuffer.=$FileRow[$I];
        }
        if(eregi("$end",$FileRow[$I+1],$Head)!="")
        {
            $Begin=0;
        }        
    }
    //begin与end中间部分
    return $TempBuffer;
}
?>

php
as、的主页 as、 | 初学一级 | 园豆:96
提问于:2012-03-16 11:14
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册