Jump to content

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


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>");

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.