<?php
$cm = curl_multi_init();
$stuffs = curl_init();
$curl_options = array(
CURLOPT_URL => 'http://www.google.ca',
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_SSL_VERIFYHOST => 0, // these are the problem
CURLOPT_SSL_VERIFYPEER => 0, // toggle 0/1 to test
CURLOPT_HEADER => 1
);
curl_setopt_array($stuffs, $curl_options);
curl_multi_add_handle($cm, $stuffs);
do { curl_multi_exec($cm, $running); } while($running > 0);
$content = curl_multi_getcontent($stuffs);
$info = curl_getinfo($stuffs);
curl_multi_remove_handle($cm, $stuffs);
curl_multi_close($cm);
print_r($info);
// cuts off too much, the header size is incorrect
echo mb_substr($content, $info['header_size']);
?>
preferences:
41.3 ms | 402 KiB | 5 Q