$api_base = "https://blockchainapi.org/api/btc?method=check_logs";
$callbackUrl = 'https://google.com?user=1&secret=123';
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $api_base.'&callback='.$callbackUrl
$response = curl_exec($curl);
$http_status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($http_status_code == 200) {
$decoded = json_decode($response, true);
if($decoded['success']) {
return json_encode($decoded['success'], JSON_PRETTY_PRINT);
// The above line will return an array of the output
return json_encode(array('error' => 'The supplied callback URL has never been sent any callbacks\/notifications.'), JSON_PRETTY_PRINT);