Reg : Read files from FTP server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sankara123
Forum Newbie
Posts: 1
Joined: Wed May 06, 2009 8:24 am

Reg : Read files from FTP server

Post 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
Defiline
Forum Commoner
Posts: 59
Joined: Tue May 05, 2009 5:34 pm

Re: Reg : Read files from FTP server

Post 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.
Post Reply