...
Excerpt |
---|
file_exists() is useful function can check the availability of the a file. Below example customized function enables you to check file availability not only local but also remote file as well. |
Code Block |
---|
// custom file_exists check file availability (local/remote) function filecfile_exists($url) { if (preg_match("/http/", $url)) { $header_response = @get_headers($url, true); if (preg_match("/200 OK/", $header_response[0])) return true; else return false; } else return (file_exists( $url) ? true:false); } |
...