Re: Re: Directory Listing

From: Date: Wed, 26 Aug 2009 13:50:13 +0000
Subject: Re: Re: Directory Listing
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.general 
Request: Send a blank email to php-general+get-297269@lists.php.net to get a copy of this message
On Wed, Aug 26, 2009 at 9:45 AM, hack988 hack988<hack988@dev.htwap.com> wrote: > I'm write a php file for you > ========================================= > define('Line_End', (PHP_OS == 'WINNT')?"\r\n":"\n"); > clearstatcache(); > > $mylist=array(); > listdir("F:\\Programming\\Web\\php",$mylist); > function listdir($dir,&$list){ >  if ($handle = opendir( $dir )){ >   while ( false !== ( $item = readdir( $handle ) ) ) { >     if ( $item != "." && $item != ".." ) { >           $item=str_replace(Line_End,"",$item); >       if ( is_dir( $dir.DIRECTORY_SEPARATOR.$item ) ) { >         listdir($dir.DIRECTORY_SEPARATOR.$item, $list); >       } else { >         > $list[]=$dir.DIRECTORY_SEPARATOR."\t".$item.."\t".date("m/d/Y", > filemtime($dir.DIRECTORY_SEPARATOR.$item)); >       } >     } >   } >   closedir( $handle ); >  } > } > var_dump($mylist); > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Why manually define Line_End when PHP_EOL already exists?

« previous php.general (#297269) next »