Page 1 of 1

Reg : Read files from FTP server

Posted: Wed May 06, 2009 8:33 am
by sankara123
Dear All,

I am new to PHP. I have one doubt.

How can read the list of files from FTP server. Files should be in ascending order of last modified time.

I request you all how to acheive.

Thanks in advance,
Sankara

Re: Reg : Read files from FTP server

Posted: Wed May 06, 2009 8:49 am
by Defiline
You can use http://php.net/manual/en/function.scandir.php to get the list of dirs and files.
In a loop use http://php.net/manual/en/function.filectime.php to get change time.
Then simply sort an array.

This is not difficult.