PHP forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
May 2024
SunMonTueWedThuFriSat
   1234
567891011
12131415161718
19202122232425
262728293031 

Calendar Calendar

Latest topics
» Kabaddi, Kabaddi, Kabaddi, Kabaddi......PHP?
Empty a Directory with PHP EmptyFri Jul 22, 2011 1:37 pm by shyamsunder

» Thousands of Free PHP Scripts Recommended
Empty a Directory with PHP EmptyWed May 18, 2011 10:33 am by bizboy12

» PHP form validation problem?
Empty a Directory with PHP EmptyWed Jan 12, 2011 1:25 pm by simy202

» string wrap
Empty a Directory with PHP EmptySat Aug 02, 2008 2:06 pm by scvinodkumar

» retrieving current date rows
Empty a Directory with PHP EmptyTue Jul 15, 2008 3:25 am by scvinodkumar

» number in words
Empty a Directory with PHP EmptyTue Apr 29, 2008 3:10 pm by scvinodkumar

» Simple PHP Form Field Generator
Empty a Directory with PHP EmptyFri Apr 25, 2008 12:28 pm by scvinodkumar

» PHP password generator
Empty a Directory with PHP EmptyFri Apr 18, 2008 7:24 pm by scvinodkumar

» PHP Script to Extract Email Address from any text
Empty a Directory with PHP EmptyFri Apr 18, 2008 7:18 pm by scvinodkumar

Search
 
 

Display results as :
 


Rechercher Advanced Search

Affiliates
free forum
 


Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Empty a Directory with PHP

Go down

Empty a Directory with PHP Empty Empty a Directory with PHP

Post  scvinodkumar Fri Apr 18, 2008 7:15 pm

<?php
function SureRemoveDir($dir, $DeleteMe) {
if(!$dh = @opendir($dir)) return;
while (false !== ($obj = readdir($dh))) {
if($obj=='.' || $obj=='..') continue;
if (!@unlink($dir.'/'.$obj)) SureRemoveDir($dir.'/'.$obj, true);
}

closedir($dh);
if ($DeleteMe){
@rmdir($dir);
}
}
?>

scvinodkumar
Admin

Posts : 40
Join date : 2008-01-30

https://solutions.aforumfree.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum