Skip to content

Instantly share code, notes, and snippets.

@joergpatz
Created March 25, 2015 12:24
Show Gist options
  • Save joergpatz/be01d29d7d7a60a8f77b to your computer and use it in GitHub Desktop.
Save joergpatz/be01d29d7d7a60a8f77b to your computer and use it in GitHub Desktop.
getimagesizefromstring-curl
//because of security option: allow_url_fopen=0
$uri = 'https://example.com/example.jpg';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$bin = curl_exec($ch);
$data = getimagesizefromstring($bin);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment