Switch to full style
Dynamic open source server-side web development
Post a reply

How to write a PHP coding to list out all files and director

Wed Feb 02, 2011 6:20 am

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.


Last edited by Andrrew on Sat Feb 05, 2011 10:40 am, edited 1 time in total.

Re: How to write a PHP coding to list out all files and director

Thu Feb 03, 2011 1:45 pm

Code:
// open the current directory  
$dirconn=opendir(".");

while ((
$file readdir($dirconn))!==false) {
echo 
"$file <br>";
}

closedir($dirconn);
 


Post a reply
  Related Posts  to : How to write a PHP coding to list out all files and director
 Write Vector list to File     -  
 Read list of files in java I/O code     -  
 servlet coding     -  
 I am new in PHP, want coding or PHP file     -  
 Java Coding     -  
 Standard Huffman Coding     -  
 Coding serialization concepts in C++     -  
 Arithmatic Coding Com-Decompression algorithm     -  
 source code of huffman coding ?     -  
 coding a simple packet sniffer     -