Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- is_dir or file_exists
- Jason Carlton
December 8, 2009, 9:08 am
rate this thread
Re: is_dir or file_exists
Jason Carlton schreef:
is_dir only return true is the passed string is actually a directory.
It will return false if it is a file.
file_exists returns true if the passed string is a file OR a directory.
So in case you are sure the passed string is a directory, I cannot think
of a difference, alltough I would be inclined to use is_dir for
directories and file_exists for files.
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
- » Help with regex, replacing " only when it occurs within <...>
- — Next thread in » PHP Scripting Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum