كود:
01function curl_get($url, array $get = NULL, array $options = array())02{   
03    $defaults = array(
04        CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get),
05        CURLOPT_HEADER => 0,
06        CURLOPT_RETURNTRANSFER => TRUE,
07        CURLOPT_TIMEOUT => 4
08    );
09    
10    $ch = curl_init();
11    curl_setopt_array($ch, ($options + $defaults));
12    if( ! $result = curl_exec($ch))
13    {
14        trigger_error(curl_error($ch));
15    }
16    curl_close($ch);
17    return $result;
18}