if ANY folder exists

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

jasonfarrell
New php-forum User
New php-forum User
Posts: 4
Joined: Thu Jul 10, 2003 11:34 am

if ANY folder exists

Postby jasonfarrell » Wed Jul 16, 2003 11:20 am

how what would i do to tell if any folder exists in the current directory, not a specific folder?

liquedus
php-forum Active User
php-forum Active User
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada
Contact:

Postby liquedus » Wed Jul 16, 2003 11:34 am

print "Folders in this directory:<br /><br />";
$dirObj = dir(getcwd());
while($f = $dirObj->read()){
if(is_dir($f)) print $f."<br />";
}

this will give you a listing of all folders in current directory :wink:


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest