Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

if ANY folder exists

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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?
jasonfarrell
New php-forum User
New php-forum User
 
Posts: 4
Joined: Thu Jul 10, 2003 11:34 am

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:
liquedus
php-forum Active User
php-forum Active User
 
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada


Return to PHP coding => General

Who is online

Users browsing this forum: asuspete, Strider64 and 10 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.