monoVertex
I'm back!
- Reaction score
- 460
Ok, I want to know if there is any PHP functions that tells if a given link is an image.
Hope you get what I mean. Thanks in advance
Hope you get what I mean. Thanks in advance
$file = "myfile.png";
$type = mime_content_type($file);
if (strcmp(substr($type, 0, 6), "image/") == 0)
{
//It's an image!
} else {
//It's not an image!
}
$file = "myfile.png";
if (exif_imagetype($file) === FALSE)
{
//It's not an image!
} else {
//It's an image!
}
And it's meant to be like that.Btw, in the second code tag, you put 3 '='