PHP Simple Thief Program

Source: Internet
Author: User
Thief Program: the Remote Web site data (Pictures, Web pages and other files) crawl to the local, processed and then displayed
Regular Expressions: pattern split, match, find, and replace operations for strings.

Related functions:

int Ereg ( string $pattern , string $string [, array &$regs ])

If the array returned by the omitted argument is found, the return value is True otherwise returns False

The corresponding eregi () is case insensitive.

string file_get_contents ( string $filename [, bool $use_include_path = False [, resource $context [, int $offset = 0 [, int $maxlen ]]])

Read the entire file, such as:

Use this function to get web page information

He is the basis of the thief program.

Like what:

$url =file_get_contents ("http://www.ubuntu.org.cn/index_kylin");

echo $url;

?>

But for another site:

$url =file_get_contents ("http://www.alangzhong.com/index.html");

echo $url;

?>

A lot of background images are found to be invisible.



View Web page source code we found that it was

src= "/upload/201503/b123ec26-bb8f-43be-b5ad-cdf45153d053.png"/>

The address of the image uses a relative path, and we do not have such a file locally, of course, it does not appear.

Select the picture with the regular expression, and then replace the relative path with the remote address:

The time-out problem for the following code is not resolved.


 
  


The above describes the PHP simple thief program, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.