function Delete($path) { if (is_dir($path) === true) { $files = array_diff(scandir($path), array('.', '..')); foreach ($files as $file) { Delete(realpath($path) . '/' . $file); } return rmdir($path); } else if (is_file($path) === true) { return unlink($path); } return false; }
语法:
$path = "images/"; Delete($path); // This will delete images folder along with its contents.
上一篇:
php根据 URL 下载图片
下一篇:
php获取当前页面 URL
友情提示:垃圾评论一律封号...