Skip to content
Advertisement

Get mime type of external file using cURL and php

I’ve used mime_content_type() and File info but i never successed. i want to use now cURL with PHP and get the headers of the file which is hosted on another domain then extract & determine if the type is MP3 or not. ( i think the mime type of MP3 is audio/mpeg )

Briefly, i know that but i don’t know how to apply it 🙂

Thanks

Advertisement

Answer

PHP curl_getinfo()

JavaScript

curl

curl -I http://www.google.com

output

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement