复制代码 代码如下:
<?php
$filename = "html/cache.txt";
$contents = "我是张斌";
if(is_writable($filename)){
if(($handle = fopen($filename,"a") )== false){
echo "写入文件 $filename 失败";
exit();
}
if(fwrite($handle,$contents) == false){
echo "写入文件$filename失败";
exit();
}
echo "写入文件 $filename 成功";
fclose($handle);
}else{
echo "文件$filename不可写入";
}
?>
新闻热点
疑难解答