Forum Moderators: coopster

Message Too Old, No Replies

is_file() or file_exists()

what should i use for a image file?

         

scriptmasterdel

2:07 pm on May 22, 2006 (gmt 0)

10+ Year Member



What would be the best and/or fastest function to run?

is_file() or file_exists()

Or even which one is best to use for an image file?

Please enlighten me =)

siMKin

3:16 pm on May 22, 2006 (gmt 0)

10+ Year Member



is_file() and file_exists() are two different functions
[php.net...]
[php.net...]

It depends on your code and what you want, what function you should use. For example, if you generate a string that should point to a file on the server and you want to know whether it exists, use file_exists(). If you are listing the contents of a directory and you want to know if a certain result is a file, use is_file().

To see if something is an image you could use this function:
[php.net...]