treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Get Image Information

Last updated on:

/*
 * @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];
}
View Comments

Comments

  1. Permalink to comment#

    will check it!

Leave a Comment

Use markdown or basic HTML and be nice.