PHP thief program is the predecessor of the acquisition, with the thief principle will write acquisition. This is PHP100 Year En IT education and training for everyone to stay in class for homework. Written a few lines about ideas and functions, the details required to collect the inside of the mailbox, author, title, content filtering, automatic image download, storage classification and other functions, but also for your reference:
index.php
<? php
$ con = file_get_contents ("http://it.sohu.com/s2010/5651/s274087241/index.shtml");
$ preg = "/ · <a href=(.*) target=_blank> (. *) </a> / U";
preg_match_all ($ preg, $ con, $ arr);
foreach ($ arr [1] as $ id => $ v) {
echo "<a href=view.php?url=$v>". $ arr [2] [$ id]. "</a> <br>";
}
?>
view.php
<? php
$ con = file_get_contents ($ _ GET [url]);
$ preg = "/ <h1> (. *) </ h1> /";
preg_match ($ preg, $ con, $ arr);
echo "<h1>". $ arr [1]. "</ h1>";
echo "<hr>";
$ preg2 = "/ <div class =" text clear "id =" contentText "collection =" Y "> (. *) </ div> / s";
preg_match ($ preg2, $ con, $ arr2);
echo $ arr2 [1];
?>