/*
*/
代码如下 | 复制代码 |
if(!function_exists('get_headers')) { function get_headers($url,$format=0) { $url=parse_url($url); $end = " "; $fp = fsockopen($url['host'], (empty($url['port'])?80:$url['port']), $errno, $errstr, 30); if ($fp) { $out = "get / http/1.1 "; $out .= "host: ".$url['host']." "; $out .= "connection: close "; $var = ''; fwrite($fp, $out); while (!feof($fp)) { $var.=fgets($fp, 1280); if(strpos($var,$end)) break; } fclose($fp); $var=preg_replace("/ .*$/",'',$var); |
时间: 2024-11-03 11:32:53