function CreateShtml()
{
ob_start(array("callback_CreateShtml","callback_GoToShtml"));
}
함수 callback_CreateShtml($buffer)
{
$page = intval(@$_REQUEST["page"]);
$fileName = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . "/" . 기본 이름($_SERVER['PHP_SELF'],".php") . ($page==0 ? "" : "_" . strval($page)) . ".htm";
$fp = fopen($fileName,"wb");
fwrite($fp,$buffer);
fclose($fp);
$buffer를 반환합니다.
}
함수 callback_GoToShtml($buffer)
{
$page = intval(@$_REQUEST["page"]);
$fileName = 기본 이름($_SERVER['PHP_SELF'],".php") . ($page==0 ? "" : "_" . strval($page)) . ".htm";
header("위치:" . $fileName);
$buffer를 반환합니다.
}
함수 GoToShtml()
{
$page = intval(@$_REQUEST["page"]);
$fileName = 기본 이름($_SERVER['PHP_SELF'],".php") . ($page==0 ? "" : "_" . strval($page)) . ".htm";
if(file_exists($fileName))
header("location:" . $fileName);
}
함수 DeleteShtml($fileName=NULL)
{
if(is_null($fileName))
$fileName = $_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF'];
if($fileName[0]=="/")
$fileName = $_SERVER['DOCUMENT_ROOT'] . $파일이름;
$path = dirname($fileName);
$dir = dir($path);
$patten = "/^" . 기본 이름($fileName, ".php") . "(_[0-9] )?.htm/";
while(($entry = $dir->read())!==false)
{
if(is_file($path . "/" .$entry) && preg_match($patten, $entry))
연결 해제 ($path . "/" . $entry);
}
}
以上就介绍了http://www.kaqima.com/index.ht PHP静态新闻列表自动生成代码 ,包括了http://www.kaqima.com/index.ht방향면적内容,希望对PHP教程有兴趣的朋友有所帮助。