/ Published in: PHP
Better Than get_headers With cURL
Expand |
Embed | Plain Text
function curl_header($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, TRUE); curl_setopt($ch, CURLOPT_NOBODY, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_close($ch); foreach ($out as $header) { $head[$matches[1]] = $matches[2]; } return $head; }
You need to login to post a comment.
