<?php
function
getImageInfo(
$image
) {
$imageInfo
=
getimagesize
(
$image
);
if
(
$imageInfo
!== FALSE) {
$imageType
=
strtolower
(
substr
(image_type_to_extension(
$imageInfo
[2]), 1));
$imageSize
=
filesize
(
$image
);
$info
=
array
(
"width"
=>
$imageInfo
[0],
"height"
=>
$imageInfo
[1],
"type"
=>
$imageType
,
"size"
=>
$imageSize
,
"mime"
=>
$imageInfo
[
'mime'
]
);
return
$info
;
}
else
{
return
FALSE;
}
}
$info
= getImageInfo(
'test.jpg'
);
var_dump(
$info
);
?>