Re: [LIP] is_dir function in php

Sandip Bhattacharya <[email protected]>
Newsgroups gmane.user-groups.linux.india.programmers
Organization Puroga Technologies Pvt. Ltd.
Message-ID <[email protected]>
On Tue, 2005-01-11 at 18:28 +0530, Logu wrote:

> #------------------------------------------------------------------
> <?php
> 
> $mydir=".";
> 
>  if ($handle = opendir("$mydir")) {
>         while (false !== ($file = readdir($handle))) {


Add this line here:
                    $file = $mydir."/".$file;


>                  if( is_dir("$file") == true )
>                          echo "$file is directory\n <br>";
>                  else
>                           echo "$file is file\n <br>";
>          }
> }
> ?>
> 



--
Sandip Bhattacharya    *    Puroga Technologies   *     sandip-/[email protected]
Work: http://www.puroga.com        *         Home: http://www.sandipb.net

PGP/GPG Signature: 51A4 6C57 4BC6 8C82 6A65 AE78 B1A1 2280 A129 0FF3




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.