Home  >  Article  >  php教程  >  php获取http-header来判断文件是否存在

php获取http-header来判断文件是否存在

WBOY
WBOYOriginal
2016-06-13 10:45:311673browse

 

想要用php写个文件探测的,可是悲剧的发现php是单线程的,速度很慢,先记录下,晚上回来在修改。

 

set_time_limit(0);

$file = 'PHP.txt';

$content = file_get_contents($file);

//echo $content;

 

$array = explode("\r\n", $content);

//print_r($array);

$url = 'http://xssxss.com'; 

for($i=0; $i

{

$header_array = get_headers ( $url.$array[$i] );  

if ($header_array [0] == 'HTTP/1.1 200 OK') {  

    echo ''.'文件存在';

       echo 'scan is finish';

} else {  

 

}

}

?>

 

本文固定链接: http://www.xssxss.com/fuck/325.xss | Shine的圣天堂-〃敏〃

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn