if folder exists

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

if folder exists

Postby jasonfarrell » Tue Jul 15, 2003 5:15 pm

how would i do this
if (file_exists($myfile)) {$truuu='"true"';} else{$truuu='"false"';}

but instead of if a file exists, a folder exists.

User avatar
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby swirlee » Tue Jul 15, 2003 6:21 pm

As far as PHP is concerned, a folder is just another file. So file_exists() should work fine, but if you want to make sure it's a directory, use is_dir().

I don't know that I'll ever forgive Apple for obfuscating the directory/folder concept. Of course, the folder model makes more sense, but I'm still bitter.

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests