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