note 93224 added to function.rmdir
| From: | xddottttsethaaatttgmaildddootcom at osu1 dot php dot net | Date: | Sat, 29 Aug 2009 01:00:11 +0000 |
| Subject: | note 93224 added to function.rmdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160012@lists.php.net to get a copy of this message | ||
// elimina un directorio recursivamente o un archivo
// basado en el código de bcairns at gmail dot com
function borrar($archivo) {
if (!is_dir($archivo)){
return unlink ($archivo);
}else{
if( substr($archivo,-1) != '/' ){ //si no termina con / lo agregamos
$archivo.= '/';
}
$files = glob( $archivo.'*', GLOB_MARK | GLOB_NOSORT | GLOB_NOESCAPE );
foreach( $files as $file ){
echo $file.'<br>';
borrar($file);
}
return rmdir($archivo);
}
}
----
Server IP: 209.41.74.194
Probable Submitter: 190.245.253.84
----
Manual Page -- http://www.php.net/manual/en/function.rmdir.php
Edit -- https://master.php.net/note/edit/93224
Del: integrated -- https://master.php.net/note/delete/93224/integrated
Del: useless -- https://master.php.net/note/delete/93224/useless
Del: bad code -- https://master.php.net/note/delete/93224/bad+code
Del: spam -- https://master.php.net/note/delete/93224/spam
Del: non-english -- https://master.php.net/note/delete/93224/non-english
Del: in docs -- https://master.php.net/note/delete/93224/in+docs
Del: other reasons-- https://master.php.net/note/delete/93224
Reject -- https://master.php.net/note/reject/93224
Search -- https://master.php.net/manage/user-notes.php