Voting

: two minus zero?
(Example: nine)

The Note You're Voting On

Kevin Gregull
16 years ago
This Function deletes everything in a defined Folder:
Works with PHP 4 and 5.

<?php
function deletefolder($path)
{
if (
$handle=opendir($path))
{
while (
false!==($file=readdir($handle)))
{
if (
$file<>"." AND $file<>"..")
{
if (
is_file($path.'/'.$file))
{
@
unlink($path.'/'.$file);
}
if (
is_dir($path.'/'.$file))
{
deletefolder($path.'/'.$file);
@
rmdir($path.'/'.$file);
}
}
}
}
}
?>

<< Back to user notes page

To Top