Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function retrieveJSON($URL) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($ch, CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_URL, $URL);
- curl_setopt($ch, CURLOPT_REFERER, $URL);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
- curl_setopt($ch, CURLOPT_TIMEOUT, 60); //timeout in seconds
- $result = curl_exec($ch);
- curl_close($ch);
- $json = json_decode($result, true);
- return $json;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement