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