Last active
January 2, 2016 20:29
-
-
Save mistic100/8356934 to your computer and use it in GitHub Desktop.
[PHP] Check if a file exists but is not dir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if a file exists but is not dir | |
* | |
* @param file | |
* @return bool | |
*/ | |
function file_exists_strict($file) | |
{ | |
return file_exists($file) && !is_dir($file); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment