Please help me write a regular code and get the webpage content through the following code $ connfile_get_contents (ygtc.tmall.com). Then, use the foo () function to process all the contained URLs and put them back to the original location, finally, the foo () function of the webpage is output as follows: function & nbsp; foo ($ url)} $ url is the input url: return & nbsp; md please help write a regular code
Obtain the webpage content using the following code:
$ Conn = file_get_contents ("http://ygtc.tmall.com ");
Then, use the foo () function to process all URLs with http: //, put them back to the original location, and finally output the webpage.
The foo () function is as follows:
Function foo ($ url )}
// $ Url is the input url
Return md5 ($ url); // here is simply the processing method of the function. In fact, the processing method is not so simple, just as an example;
}
------ Solution --------------------
$ Conn = file_get_contents ("http://ygtc.tmall.com ");
Echo preg_replace_callback ('/(
Function foo ($ url ){
Return $ url [1]. md5 ($ url [2]); // Here we simply write the processing method of the function. In fact, the processing method is not that simple, just as an example;
}