note 76641 added to function.ftp-nlist

From: Date: Tue, 24 Jul 2007 09:51:19 +0000
Subject: note 76641 added to function.ftp-nlist
Groups: php.notes 
Request: Send a blank email to php-notes+get-128862@lists.php.net to get a copy of this message
I've made a recursive function to list all files from folders and subfolders using ftp_rawlist() . I used the function below from ari, parse_rawlist() function list_all_files($conn_id, $path){ $buff = ftp_rawlist($conn_id, $path); $res = parse_rawlist( $buff) ; static $flist = array(); if(count($res)>0){ foreach($res as $result){ // verify if is dir , if not add to the list of files if($result['size']== 0){ // recursively call the function if this file is a folder list_all_files($conn_id, $path.'/'.$result['name']); } else{ // this is a file, add to final list $flist[] = $result; } } } return $flist; } ---- Server IP: 195.221.21.36 Probable Submitter: 195.248.4.144 ---- Manual Page -- http://www.php.net/manual/en/function.ftp-nlist.php Edit -- https://master.php.net/note/edit/76641 Del: integrated -- https://master.php.net/note/delete/76641/integrated Del: useless -- https://master.php.net/note/delete/76641/useless Del: bad code -- https://master.php.net/note/delete/76641/bad+code Del: spam -- https://master.php.net/note/delete/76641/spam Del: non-english -- https://master.php.net/note/delete/76641/non-english Del: in docs -- https://master.php.net/note/delete/76641/in+docs Del: other reasons-- https://master.php.net/note/delete/76641 Reject -- https://master.php.net/note/reject/76641 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128862) next »