• 18-05-2020, 18:37:26
    #1
    merhaba get curl işlemlerinde headerlarını ekrana yazdırmak için kullanılan php kodu bu şekilde .

    file_get_contents('https://r10.net');
    // eğer header bilgilerini çekmek istiyorsam.
    var_dump($http_response_header);
    // şeklinde ekrana yazabiliyorum 
    fakat bunu curl işleminde nasıl yapılıyor.
  • 18-05-2020, 18:38:57
    #2
    Şu şekilde

    $ch = curl_init();curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_VERBOSE, 1);curl_setopt($ch, CURLOPT_HEADER, 1);// ...$response = curl_exec($ch);// Then, after your curl_exec call:$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);$header = substr($response, 0, $header_size);$body = substr($response, $header_size);