PHP file exists - simple check

PHP file exist : PHP file exist is easily way to check if file exist on server or not. if you are running on website , you need user root directory for proper execution ..

Use below code :


echo file_exists($file) ; 

If file exists on server , it will show you output - 1  
if file doesn't exists on server, result will null 

Please note below script may not work-  avoid to use direct URL. Use only root directory.
echo file_exists("") ;