PHP Check if file does not exist

Hi all,

I need to check if a file does not exist in php.

for example:

If File Does NOT Exist {
  Do something

No extra condition is needed.

Who is Participating?

if( !file_exists('/path/to/file.ext') ) {
   // Do something

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.