Jump to content

[SOLVED] file_exists() function


pauleth

Recommended Posts

Do you need to provide an absolute path for this function to work, or can you include a path relative to where the script resides?

 

For example, if I have the php script in a directory called mySite, and I have a directory in mySite called images, can I reference a file in the images directory as:

 

$image = "images/myFile.jpg";

if (!file_exists($image)) {

    $error = "File does not exist!";

}

 

Thanks in advance for your input.

Link to comment
https://forums.phpfreaks.com/topic/101725-solved-file_exists-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.