note 21827 added to function.ftp-rmdir
| From: | php-general at lists dot php dot net | Date: | Tue, 28 May 2002 17:24:54 +0000 |
| Subject: | note 21827 added to function.ftp-rmdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31105@lists.php.net to get a copy of this message | ||
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".
--
http://www.php.net/manual/en/function.ftp-rmdir.php
http://master.php.net/manage/user-notes.php?action=edit+21827
http://master.php.net/manage/user-notes.php?action=delete+21827
http://master.php.net/manage/user-notes.php?action=reject+21827