#stackoverlog#php

How to get MIME-type of an image with file_get_contents in PHP

Use following snippet:

$file_info = new finfo(FILEINFO_MIME_TYPE);
$mime_type = $file_info->buffer(file_get_contents($image_url));
echo $mime_type;
An Tran

An Tran

A passionate web developer, self-learner and music lover.

Read More