Created
September 4, 2014 20:27
-
-
Save Kudratullah/cef5c591bd0afa687ee6 to your computer and use it in GitHub Desktop.
Get Remote File Type Via PHP CURL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# the request | |
$file = file_get_contents('http://www.videojs.com/js/video-js.swf'); | |
$file_url = 'http://www.videojs.com/js/video-js.swf'; | |
echo "<br>"; | |
$ch = curl_init($file_url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_exec($ch); | |
# get the content type | |
echo curl_getinfo($ch, CURLINFO_CONTENT_TYPE); | |
echo "<br>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment