Mega Code Archive

 
Categories / Php / Code Snippets
 

DIsplay the content type of a file with PHP and cURL

<?php //googles small gif logo $curl = curl_init('http://www.google.com/images/logo_sm.gif'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); curl_exec($curl); //get the content type print("Content type: " . curl_getinfo($curl, CURLINFO_CONTENT_TYPE) .'<br>'); ?>