PHP生成靜態(tài)頁
更新時間:2006年11月25日 00:00:00 作者:
復制代碼 代碼如下:
<?
function makedir($mudir) //創(chuàng)建目錄
{
$file = "./$mudir";
@mkdir($file,0777);
}
function writemod($filemodname) //先創(chuàng)子摸板文件路徑
{
$fp=fopen("showmod.shtml","r");
$str=fread($fp,filesize("showmod.shtml"));
fclose($fp);
$fp=fopen($filemodname,"w");
fwrite($fp,$str);
fclose($fp);
}
function writeweb($content,$web,$modfile) //更新各自的子摸板文件//$modfile是子摸板名字
{
$fp=fopen($modfile,"r");
$str=fread($fp,filesize($modfile));
$str=str_replace($content,$web,$str);
fclose($fp);
$fp = fopen($modfile,"w");
fwrite($fp,$str);
fclose($fp);
}
$m = "00000";
makedir($m);
$ff = $m."/0001.shtml";
if(!file_exists($ff))
{
writemod($ff);
}
else
{
echo"已經(jīng)存在";
}
$d="{content6}"; //被更新的內容
$dd="";//要更新的內容//要更新的內容
@writeweb($d,$dd,$ff);
?>
function makedir($mudir) //創(chuàng)建目錄
{
$file = "./$mudir";
@mkdir($file,0777);
}
function writemod($filemodname) //先創(chuàng)子摸板文件路徑
{
$fp=fopen("showmod.shtml","r");
$str=fread($fp,filesize("showmod.shtml"));
fclose($fp);
$fp=fopen($filemodname,"w");
fwrite($fp,$str);
fclose($fp);
}
function writeweb($content,$web,$modfile) //更新各自的子摸板文件//$modfile是子摸板名字
{
$fp=fopen($modfile,"r");
$str=fread($fp,filesize($modfile));
$str=str_replace($content,$web,$str);
fclose($fp);
$fp = fopen($modfile,"w");
fwrite($fp,$str);
fclose($fp);
}
$m = "00000";
makedir($m);
$ff = $m."/0001.shtml";
if(!file_exists($ff))
{
writemod($ff);
}
else
{
echo"已經(jīng)存在";
}
$d="{content6}"; //被更新的內容
$dd="";//要更新的內容//要更新的內容
@writeweb($d,$dd,$ff);
?>
相關文章
thinkPHP+PHPExcel實現(xiàn)讀取文件日期的方法(含時分秒)
這篇文章主要介紹了thinkPHP+PHPExcel實現(xiàn)讀取文件日期的方法,可實現(xiàn)針對時分秒的形式進行讀取的功能,涉及PHPExcel中ExcelToPHP函數(shù)的相關使用方法,需要的朋友可以參考下2016-07-07destoon調用企業(yè)會員公司形象圖片的實現(xiàn)方法
這篇文章主要介紹了destoon調用企業(yè)會員公司形象圖片的實現(xiàn)方法,非常實用,需要的朋友可以參考下2014-08-08