Function PHP Get Image Information
/* * @param string $file Filepath * @param string $query Needed information (0 = width, 1 = height, 2 = mime-type) * @return string Filei...
https://iskablogs.blogspot.com/2014/03/function-php-get-image-information.html
/*
* @param string $file Filepath
* @param string $query Needed information (0 = width, 1 = height, 2 = mime-type)
* @return string Fileinfo
*/
function getImageinfo($file, $query) {
if (!realpath($file)) {
$file = $_SERVER["DOCUMENT_ROOT"].$file;
}
$image = getimagesize($file);
return $image[$query];
}
* @param string $file Filepath
* @param string $query Needed information (0 = width, 1 = height, 2 = mime-type)
* @return string Fileinfo
*/
function getImageinfo($file, $query) {
if (!realpath($file)) {
$file = $_SERVER["DOCUMENT_ROOT"].$file;
}
$image = getimagesize($file);
return $image[$query];
}