Skip to content

Instantly share code, notes, and snippets.

@uzulla
Created July 3, 2012 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uzulla/3038607 to your computer and use it in GitHub Desktop.
Save uzulla/3038607 to your computer and use it in GitHub Desktop.
Proxy get
<?php
$url = $_GET['u'];
if( preg_match('/^http:\/\/[a-zA-Z0-9]{1,5}.twimg.com/',$url) ){
$img = file_get_contents($url);
foreach($http_response_header as $head){
if(preg_match('/^Content-Type/',$head)){
header($head);
break;
}
}
echo $img;
}else{
echo 'invalid url';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment