Quantcast
Viewing latest article 4
Browse Latest Browse All 8

Answer by Avis for PHP- Get file type by URL

<?php $image_path="http://fc04.deviantart.net/fs71/f/2010/227/4/6/PNG_Test_by_Destron23.png"; echo exif_imagetype($image_path);?>

It returned 3 because png response type as maciej said.

Try this to get like this image/png:

echo mime_content_type($image_path);

Try this:

$finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension   echo finfo_file($finfo, $image_path) . "\n";finfo_close($finfo);

Viewing latest article 4
Browse Latest Browse All 8

Trending Articles