content of a web page using PHP-PHP Tutorial-php.cn
Home > Backend Development > PHP Tutorial > How to intercept the content of a web page using PHP

How to intercept the content of a web page using PHP

WBOY
Release: 2016-08-08 09:34:15
Original
1158 people have browsed it

For example, the URL we want to obtain is: http://www.codes51.com

The code is as follows:

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


The above introduces the method of using PHP to intercept the content of web page , including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template