求助,谁可以帮写一个批量删除后缀为.bak文件的php
老虎的那个在我空间使用要出错,
Warning : include(css.php) [ function.include ]: failed to open stream: No such file or directory in D:\vip\chen9818\web\******\ubb.php online 6
Warning : include() [ function.include ]: Failed opening 'css.php' for inclusion (include_path='.;C:\php5\pear')in D:\vip\chen9818\web\******\ubb.php online 6
(上面是进去时是这样的)
下面是提交过后
Warning : readdir(): supplied argument is not a valid Directory resource in D:\vip\chen9818\web\******\delbak.php on line 15
Warning : readdir(): supplied argument is not a valid Directory resource in D:\vip\chen9818\web\******\delbak.php on line 16
Warning : readdir(): supplied argument is not a valid Directory resource in D:\vip\chen9818\web\******\delbak.php on line 17
Warning : include(css.php) [ function.include ]: failed to open stream: No such file or directory in D:\vip\chen9818\web\******\ubb.php online 6
Warning : include() [ function.include ]: Failed opening 'css.php' for inclusion (include_path='.;C:\php5\pear')in D:\vip\chen9818\web\******\ubb.php online 6
<?php
function scan($dir){
foreach(glob($dir.'/*') as $i){
if(is_file($i) AND end(explode('.',$i))=='bak') unlink($i);
if(is_dir($i)) scan($i);
}}
scan('.');
?>