Home > php教程 > php手册 > PHP100教你20行代码写小偷程序

PHP100教你20行代码写小偷程序

WBOY
Release: 2016-06-13 10:40:26
Original
1433 people have browsed it

PHP小偷程序是采集的前身,有了小偷原理才会写采集。这是bkJia创恩IT教育培训给大家上课时候给大家留的作业。随手写了几行大概思路和功能,细节要求采集到里面的邮箱,作者,标题,内容过滤,图片自动下载,入库分类等功能,也供大家参考下:

 

 

 

 

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];

?>

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template