Created
March 4, 2011 02:36
-
-
Save cutmail/854075 to your computer and use it in GitHub Desktop.
Here is the function that would checking whether the given path is directory or not, using ftp_nlist;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function filecollect($conn_id,$dir='.') { | |
static $flist=array(); | |
if ($files = ftp_nlist($cid,$dir)){ | |
foreach ($files as $file) { | |
if (ftp_size($cid, $file) == "-1"){ | |
filecollect($cid,$file); | |
} else $flist[] = $file; | |
} | |
} | |
return $flist; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment