/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Basic cURL wrapper function for PHP * @link http://snipplr.com/view/51161/basic-curl-wrapper-function-for-php/ * @param string $url URL to fetch * @param array $curlopt Array of options for curl_setopt_array * @return string */ CURLOPT_TIMEOUT => 2, CURLOPT_RETURNTRANSFER => 1, CURLOPT_FOLLOWLOCATION => 1, CURLOPT_USERAGENT => "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 AlexaToolbar/alxf-1.54 Firefox/3.6.13 GTB7.1" ); if($response === false) return $response; }