欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php下刪除一篇文章生成的多個(gè)靜態(tài)頁面

 更新時(shí)間:2010年08月08日 17:06:48   作者:  
php自定義函數(shù)之刪除一篇文章生成的多個(gè)靜態(tài)頁面,可能有多頁的文章,都是需要考慮到的。
復(fù)制代碼 代碼如下:

//– 刪除一篇文章生成的多個(gè)靜態(tài)頁面
//– 生成的文章名為 5.html 5_2.html 5_3.html
/*—————————————————— */
function delStaticHtml ($article_id)
{
global $db;
$sql = “SELECT `post_time` FROM `@__article` WHERE `article_id` = ‘{$article_id}'”;
$art = $db->getOne ($sql);
if ($art)
{
$n = 1;
$html_dir = ‘../html/'.date(‘Ym',$art['post_time']).'/';
$filename = $html_dir.$article_id.'.html';
while (file_exists($filename))
{
@unlink($filename);
$n++;
$filename = $html_dir.$article_id.'_'.$n.'.html';
}
}
return false;
}

相關(guān)文章

最新評(píng)論