Re: Re: Directory Listing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 26, 2009 at 9:45 AM, hack988 hack988<hack988@xxxxxxxxxxxxx> 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?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux