Skip to content

Instantly share code, notes, and snippets.

@lloc
Created October 1, 2011 15:59
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 lloc/1256238 to your computer and use it in GitHub Desktop.
Save lloc/1256238 to your computer and use it in GitHub Desktop.
my_fopen
<?php
function my_fopen ($url) {
$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec ($ch);
$errno = curl_errno ($ch);
curl_close ($ch);
return (array ($errno, $content));
}
list ($error, $result = my_fopen ("http://lloc.de/");
?>
@lloc
Copy link
Author

lloc commented Oct 1, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment