tags:

views:

80

answers:

2

I want to check if there is a directory exist or not before uploading a file.

If the directory does not exist return FALSE.

Does is_dir do the work?

+1  A: 

is_dir() well check if the first argument is a directory and is_file() will check if the first argument is a file.

They both return true if the dir/file exists, and false if not.

William
+3  A: 

Yes is_dir() is the solution. Did you try it?

NA