Home  >  Article  >  php教程  >  截获网站<title></title&

截获网站<title></title&

WBOY
WBOYOriginal
2016-06-13 10:34:031419browse

参考:http://www.netasp.com.cn/valley/gettitle/index.php

代码如下:

 <br>
 <br>
//get_title.php <br>
$file=file("http://www.netasp.com.cn"); <br>
$count=count($file); <br>
<br>
for($i=0;$i
  if(eregi("<title>(.*)</title>",$file[$i],$out)){ <br>
  $title=$out[0]; <br>
  } <br>
} <br>
<br>
$title=substr($title,7,-8); <br>
echo $title; <br>
?> <br>
  

【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】    

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