| AND OR | string words | *

directories

|

read dir and list


read and list directory function


function read_dir( ) [ line 3 ]



full source of read dir and list [ line 1 - 28 ] | download read dir and list

1    <?php
2   //------->function read & list start
3   function read_dir ($root ,$filter )
4   {
5       $root_dir =opendir ($root );
6       while ( $file_file =readdir ($root_dir ))
7       {
8           if ( is_dir ($file_file ) && $file_file != '.' && $file_file != '..' && substr ($file_file ,0,strlen ($filter )) == $filter )
9           {
10               $mtime filemtime($file_file);
11               $array = array ( '_' => ' ' ,$filter => '' );
12               $thefile =strtr ($file_file ,$array );
13               echo '
14               <a href="'.$file_file .'" title="last modified on '.date("D d M Y g:i A"$mtime).'">'.$thefile .'</a>
15               <br>';
16           } 
17       } 
18   
19   //------->function read & list end 
20   $user =getenv ('REMOTE_ADDR' );
21   $server =getenv ('SERVER_ADDR' ); 
22   if ( $user != $server )
23   {
24       read_dir ('.' ,'pub_' );
25   }else{ 
26       read_dir ('.' ,'priv_' );
27   }
28   ?>



26 hits by 17 users in the last 30 minutes.