<?php
function
del_dir(
$dir
){
{
if
(!
$dir
) {
return
; }
$cacheDir
=
$dir
;
$dh
= opendir(
$cacheDir
);
while
(
$file
= readdir(
$dh
) ) {
if
((
$file
==
'.'
) || (
$file
==
'..'
)) {
continue
; }
if
(
file_exists
(
$cacheDir
.
'/'
.
$file
)) {
if
(
is_dir
(
$cacheDir
.
'/'
.
$file
)){
del_dir(
$cacheDir
.
'/'
.
$file
);
}
elseif
(!unlink(
$cacheDir
.
'/'
.
$file
)) {
}
}
}
}
}
?>