Search code examples
phpsyntax-errorfile-exists

file_exist() not working and stopping all code from being executed underneath it


Like The title says, I am stumped. I used this function many times in the past with success but now all of a sudden it will just not work at all. Everything above it will be displayed normally, everything underneath it vanishes. The given file path is correct since the require works perfectly fine with the same file.

//this works
require $_SERVER['DOCUMENT_ROOT']."/custom/phsh/includes/login.php";

//this doesn't return anything it just stops the code right here
echo file_exist($_SERVER['DOCUMENT_ROOT']."/custom/phsh/includes/login.php");


Solution

  • It was a darn spelling error, I wrote file_exist(); but its supposed to be file_exists();