protected function getResponseBody($string) { $lines = explode("\r\n", $string); $isHeader = true; $headers = $content = array(); while ($lines) { $nextLine = array_shift($lines); if ($isHeader && $nextLine == '') { $isHeader = false; continue; } if ($isHeader) { $headers[] = $nextLine; } else { $content[] = $nextLine; } } return implode("\r\n", $content); }