Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getCurl($url)
- {
- $curl = curl_init();
- curl_setopt_array($curl, array(
- CURLOPT_URL => $url,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => "",
- CURLOPT_TIMEOUT => 30000,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => "GET",
- CURLOPT_HTTPHEADER => array(
- // Set Here Your Requesred Headers
- 'public-key: VXGNq3GcR73gNJ2FLN2cMZwHPPujy71yrveK0scORS7KzoXWVyjXjh6vzZ1spvzg',
- 'Content-Type: application/json',
- ),
- ));
- $response = curl_exec($curl);
- $err = curl_error($curl);
- curl_close($curl);
- if ($err) {
- $result = "cURL Error #:" . $err;
- } else {
- $result = json_decode($response);
- }
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement