1<?php
2// this is an alternative of file_get_contents();
3// with Curl >>
4
5function url_get_contents ($Url) {
6 if (!function_exists('curl_init')){
7 die('CURL is not installed!');
8 }
9 $ch = curl_init();
10 curl_setopt($ch, CURLOPT_URL, $Url);
11 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
12 $output = curl_exec($ch);
13 curl_close($ch);
14 return json_decode($output,JSON_OBJECT_AS_ARRAY);
15}
16
17?>