Lorretta Posted July 8, 2011 Share Posted July 8, 2011 How to write a PHP coding to list out all files and directories as links to them? This is somewhat similar to some index pages. When new file or folder is added to the directory, HTML page should display the newly created file/folder together with previous ones after it is being refreshed. (prefer in alphabatical order) How to achieve this sort of functionality in PHP? Please provide sample coding as well. (and any references) Thanks. -------------------------------------------------------------------------------------------------- Spammity spam links removed. Quote Link to comment https://forums.phpfreaks.com/topic/241400-how-to-write-a-php-coding-to-list-out-all-files-and-directories-as-links-to-them/ Share on other sites More sharing options...
TeNDoLLA Posted July 8, 2011 Share Posted July 8, 2011 You can use this: http://php.net/manual/en/class.directoryiterator.php and there is plenty of examples in the manual pages. Note that this is only one way to do it. Quote Link to comment https://forums.phpfreaks.com/topic/241400-how-to-write-a-php-coding-to-list-out-all-files-and-directories-as-links-to-them/#findComment-1240005 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.