note 73610 added to function.curl-setopt

From: Date: Sat, 03 Mar 2007 14:36:08 +0000
Subject: note 73610 added to function.curl-setopt
Groups: php.notes 
Request: Send a blank email to php-notes+get-124041@lists.php.net to get a copy of this message
In response to "brett at brettbrewer dot com" and Jamolkhon, the fact you don't take into account is when a redirection (Location: ...) occurs, all the headers are given so the \r\n\r\n can also separate twp consecutive headers. An even better trick to get the header is to use CURLINFO_HEADER_SIZE : $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $headers = substr($output, 0, $header_size - 4); $body = substr($output, $header_size); Then $headers contains all the headers. ---- Server IP: 194.153.94.10 Probable Submitter: 84.74.185.34 ---- Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php Edit -- https://master.php.net/note/edit/73610 Del: integrated -- https://master.php.net/note/delete/73610/integrated Del: useless -- https://master.php.net/note/delete/73610/useless Del: bad code -- https://master.php.net/note/delete/73610/bad+code Del: spam -- https://master.php.net/note/delete/73610/spam Del: non-english -- https://master.php.net/note/delete/73610/non-english Del: in docs -- https://master.php.net/note/delete/73610/in+docs Del: other reasons-- https://master.php.net/note/delete/73610 Reject -- https://master.php.net/note/reject/73610 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#124041) next »