<html>
<body>
<?php
$file = "1.txt";
$d=date("m");
if ($d=="7")
{
unlink($file);
echo "文件已删除!";
}
else
{
echo "文件尚未过期!";
}
?>
</body>
</html>
//php页面为utf编码
header("Content-type: text/html; charset=utf-8");
//php页面为gbk编码
header("Content-type: text/html; charset=gb2312");
//php页面为big5编码
header("Content-type: text/html; charset=big5");
<META http-equiv="content-type" content="text/html; charset=xxx(此处改为相应的编码)">
{
删除代码;
输出,已删除
}
else
{
输出,还没删除,
}
希望能帮到你