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.