note 118428 added to function.is-file
| From: | www.ip4t.net-abdelrahmannourallah | Date: | Fri, 04 Dec 2015 11:37:50 +0000 |
| Subject: | note 118428 added to function.is-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204278@lists.php.net to get a copy of this message | ||
sometimes this function does not work because permission ,
you can use this function that check if the path has dot in last will return true .
public function isFile($file) {
$f = pathinfo($file, PATHINFO_EXTENSION);
return (strlen($f) > 0) ? true : false;
}
isfile('http://www.ip4t.net/image.jpg');
you should replace a string between '' with your file path to check
----
Server IP: 72.52.91.14
Probable Submitter: 86.108.67.158
----
Manual Page -- http://php.net/manual/en/function.is-file.php
Edit -- https://master.php.net/note/edit/118428
Del: integrated -- https://master.php.net/note/delete/118428/integrated
Del: useless -- https://master.php.net/note/delete/118428/useless
Del: bad code -- https://master.php.net/note/delete/118428/bad+code
Del: spam -- https://master.php.net/note/delete/118428/spam
Del: non-english -- https://master.php.net/note/delete/118428/non-english
Del: in docs -- https://master.php.net/note/delete/118428/in+docs
Del: other reasons-- https://master.php.net/note/delete/118428
Reject -- https://master.php.net/note/reject/118428
Search -- https://master.php.net/manage/user-notes.php