• 16-08-2022, 18:16:16
    #1
    Merhaba,

    Bu koddaki sonucu nasıl yazdırabilirim? Json olarak dönüyor sanırım.

    <?php $ip = '148.56.53.217'; //-- IP to consult 
    $apiKey = 'your_api_key'; 
    
    $headers = [    'X-Key: '.$apiKey, ]; 
    
    $ch = curl_init("https://www.iphunter.info:8082/v1/ip/".$ip); 
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
    $output = json_decode(curl_exec($ch), 1); 
    $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); 
    curl_close($ch);
  • 16-08-2022, 22:14:37
    #2
    Print_r($output);
  • 16-08-2022, 23:18:38
    #3
    $output değişkenindeki verileri print_r() ile okuyup, gelen json değişkenlerini ise echo $output["json_veri"] şeklinde okutabilirsin.
  • 17-08-2022, 02:35:57
    #4
    WebCoderx adlı üyeden alıntı: mesajı görüntüle
    $output değişkenindeki verileri print_r() ile okuyup, gelen json değişkenlerini ise echo $output["json_veri"] şeklinde okutabilirsin.
    Teşekkür ederim