Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php curl get response body

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #curl #response #body
ADD COMMENT
Topic
Name
2+7 =