Jump to content

Using file_exists() function always return false even if the file exists?


jack5100nv

Recommended Posts

I am using the file_exists() function to check if the file exists before including it but it always returns false

 

If I take out the file_exists function, I can see that the include function includes the file correct without any errors.

 

Here is the code. what am I doing wrong?

 

$languagefilename = "language/english.php";

 

if (is_readable($languagefilename))

  include($languagefilename);

else

    echo("<br><center><b>The file for selected language is missing from the Language folder</b></center><br>");

I mean the code is

 

$languagefilename = "language/english.php";

 

if (file_exists($languagefilename))

  include($languagefilename);

else

    echo("<br><center><b>The file for selected language is missing from the Language folder</b></center><br>");

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.