Returning header as array using Curl

前端 未结 9 1905
再見小時候
再見小時候 2020-12-01 04:22

I\'m trying to get the response & the response headers from CURL using PHP, specifically for Content-Disposition: attachment; so I can return the filename passed within

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-01 05:11

    Using the array() form for method callbacks should make the original example work:

    curl_setopt($this->_ch, CURLOPT_HEADERFUNCTION, array($this, 'readHeader'));

提交回复
热议问题