正则表达式

来源:互联网 发布:我是未来 阿里云 编辑:程序博客网 时间:2024/05/17 07:42

$cachedir="./data/html/".$model;   //Cache文件的路径;if ($dh = opendir($cachedir)) {     //打开Cache文件夹;    while (($file = readdir($dh)) !== false) {//遍历Cache目录,        $del = '/^index\_'.$material['url'].'\w+\.html/';        $a = preg_match($del,$file);        if(preg_match($del,$file)){            $delfile = $cachedir.'/'.$file;            $delres = unlink($delfile);                //删除遍历到的每一个文件;        }    }    closedir($dh);}




http://bbs.php100.com/read-htm-tid-83266.html

0 0