[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PHP Check if file does not exist

Posted on 2011-10-30
1
Medium Priority
?
324 Views
Last Modified: 2012-08-14
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.

THanks
0
Comment
Question by:error77
1 Comment
 
LVL 10

Accepted Solution

by:
Derokorian earned 2000 total points
ID: 37054174
http://us2.php.net/file_exists

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

Open in new window

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month18 days, 22 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question