Home  >  Article  >  Backend Development  >  截获网站title标签之家内容的例子_php基础

截获网站title标签之家内容的例子_php基础

WBOY
WBOYOriginal
2016-05-17 09:45:081153browse

参考: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