写入文件:
function writefile($path,$value){
$hand = fopen($path,'a');
fwrite($hand,$value);
@fclose($hand);
}
删除文件:
function deletefile(){
$dir = str_replace('\','/',dirname(__FILE__)).'/dir';
$dh=opendir($dir);
while (false !== ($file=readdir($dh))) {
if($file!="." && $file!="..") {
$fullpath=$dir."/".$file;
if(!is_dir($fullpath)){
unlink($fullpath);
}
}
}
closedir($dh);
}