Skip to content

Instantly share code, notes, and snippets.

@cutmail
Created March 4, 2011 02:36
Show Gist options
  • Save cutmail/854075 to your computer and use it in GitHub Desktop.
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;
<?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