making rest api using curl in php code example
Example 1: create curl api request php with para
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "api.example.com");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($curl);
curl_close($curl);
Example 2: create curl api request php with para
$get_data = callAPI('GET', 'https://api.example.com/get_url/'.$user['User']['customer_id'], false);
$response = json_decode($get_data, true);
$errors = $response['response']['errors'];
$data = $response['response']['data'][0];
Example 3: create curl api request php with para
callAPI('DELETE', 'https://api.example.com/delete_url/' . $id, false);