I’ve seen this somewhere, but can’t seem to remember. How can I use getimagesize() to return the file type?
$url = (POST_IMAGESELECTOR);
$path_parts = pathinfo($url);
if ($path_parts !='') {
$extension = $path_parts['extension'];
} else {
$extension = getimagesize($url);
}
Given the documentation,
getimagesizereturn an array of 7 values.The one you can use are:
And / Or: