note 53521 deleted from function.is-file by derick
| From: | derick@php.net | Date: | Fri, 04 Aug 2006 11:12:13 +0000 |
| Subject: | note 53521 deleted from function.is-file by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-115541@lists.php.net to get a copy of this message | ||
Note Submitter: kkrizka at gmail dot com
----
The following will "guess" if something is a file in case it is not availible.
function isfile($page) {
//get the top file/dir
$file=basename($page);
// ends in a slash, so is a dir
if(substr($file,strlen($file)-1)=='/') {
return false;
}
//find all dots
$a=explode('.',$file);
//there is a dot, means it is a file with a extension
//beware of http://www.site.com
if(count($a)>1) {
return true;
} else {
return false
}
}