php and curl: get headers from response

by prettyscripts on 2011-08-23 12:28:00 • Leave a comment »

phpcode

for beinners, please check this example on how to use curl library. to include headers in response, setĀ CURLOPT_HEADER to 1 in curl options. ie, curl_setopt_array($ch, array( ... CURLOPT_HEADER => 1, ... ); to include headers o… more »

Tags: body, curl, header, http, php, response

fetching data from remote site

by prettyscripts on 2008-05-13 21:29:17 • Leave a comment »

miscphpcode

using cURL functions:$c = curl_init();curl_setopt_array($c, $opts); $data = curl_exec($c); $info = curl_getinfo($c);$error = curl_error($c);curl_close($c);line 2: see next section on $optline 3: data will be returned if CURLOPT_RET… more »

Tags: curl, data, php