↧
Answer by Jehad Ahmad Jaghoub for PHP- Get file type by URL
the best way for my understanding if (!function_exists('getUrlMimeType')) { function getUrlMimeType($url) { $buffer = file_get_contents($url); $finfo = new finfo(FILEINFO_MIME_TYPE); return...
View ArticleAnswer by pgee70 for PHP- Get file type by URL
Here is a PHP function I came up with:/** * @param $image_path * @return string|null */function get_image_mime_type(string $image_path):?string{ $mimes = [ IMAGETYPE_GIF => "image/gif",...
View ArticleAnswer by Gentle153 for PHP- Get file type by URL
You are not going wrong anywhere. exif_imagetype returns the value of one of the image type constants: http://php.net/manual/en/image.constants.phpIf you would like to convert this to an extension...
View ArticleAnswer 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...
View ArticleAnswer by Maciej Asembler for PHP- Get file type by URL
3 is image type response for PNG image. See:http://php.net/manual/en/function.exif-imagetype.php
View ArticleAnswer by Grice for PHP- Get file type by URL
exif_imagetype returns the image type. The response, 3, indicates it is IMAGETYPE_PNG, the correct response.
View ArticleAnswer by Alex Howansky for PHP- Get file type by URL
In the first example, you're getting a blank page because you're not doing anything with the return value from the function call. In the second example, you're getting a valid response. See the manual...
View ArticlePHP- Get file type by URL
I want to get the file type (eg. image/gif) by URL using PHP.I had...
View Article
More Pages to Explore .....