Snippets Directory
php
Posted by Emil Andersson 6 år, 8 månader sedan
Få information om bild
Få information om bild med PHP
/* * @param string $file Filväg * @param string $query Nödvändig införmation (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]; }
You must be logged in to comment.