Skip to content

Instantly share code, notes, and snippets.

@tpai
Created September 25, 2014 17:57
Show Gist options
  • Save tpai/2a8331b349e0f443f32c to your computer and use it in GitHub Desktop.
Save tpai/2a8331b349e0f443f32c to your computer and use it in GitHub Desktop.
file_get_contents.php
<?php
header("Access-Control-Allow-Origin: *");
$opts = array('http'=>array('header' => "User-Agent:MyAgent/1.0\r\n"));
$context = stream_context_create($opts);
echo file_get_contents($_GET['url'], false, $context);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment