note 21827 deleted from function.ftp-rmdir by aidan
| From: | aidan@php.net | Date: | Fri, 29 Jul 2005 07:08:52 +0000 |
| Subject: | note 21827 deleted from function.ftp-rmdir by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-92697@lists.php.net to get a copy of this message | ||
Note Submitter:
----
The above does not work correctly. This should:
function removedirR($conn,$dirName){
$ar_files = ftp_nlist($conn, $dirName);
if (is_array($ar_files)){
for ($i=0;$i<count($ar_files);$i++){
$st_file = $ar_files[$i];
if (ftp_size($conn, $st_file) == -1){
$this->removedirR( $st_file);
} else {
ftp_delete($conn, $st_file);
}
}
}
ftp_rmdir($conn, $dirName);
}
NOTE: make sure that $dirname = "the full path of the file or directory".