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?
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:
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: No registered users and 1 guest

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