Home  >  Article  >  Backend Development  >  PHP100 teaches you how to write a thief program in 20 lines of code_PHP Tutorial

PHP100 teaches you how to write a thief program in 20 lines of code_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:41:571059browse

The PHP thief program is the predecessor of collection. Only with the thief principle can we write collection. This is the homework given to you by bkJiaChuangen IT Education during the training. I casually wrote a few lines of general ideas and functions. The details require collecting the email address, author, title, content filtering, automatic downloading of pictures, storage classification and other functions. For your reference:

index.php

$con = file_get_contents("http://it.sohu.com/s2010/5651/s274087241/index.shtml");
$preg="/·(.*)/U";
preg_match_all($preg,$con,$arr);
foreach($arr[1] as $id=>$v){
echo "".$arr[2][$id]."
";
}
?>

view.php

$con = file_get_contents($_GET[url]);
$preg="/

(.*)

/";
preg_match($preg,$con,$arr);
echo "

".$arr[1]."

";
echo "
";
$preg2="/
(.*)
/s";
preg_match($preg2,$con,$arr2);
echo $arr2[1];

?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486111.htmlTechArticlePHP thief program is the predecessor of collection. Only with the thief principle can we write collection. This is the homework given to you by PHP100 Chuangen IT Education training during class. I jotted down a few lines of general ideas and...
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