Please help write a regular code

Source: Internet
Author: User
Ask a master to help write a regular code
Get the content of the Web page by following the code

$conn =file_get_contents ("http://ygtc.tmall.com");

Then, all of the URLs with HTTP.///are processed by the Foo () function, put back in place, and finally output the Web page
The Foo () function is as follows

function foo ($url)}
$url for incoming URLs
return MD5 ($URL);//Here is simply a simple way to write down 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 is simply a simple way to write down the function, in fact, the processing method is not so simple, just as an example;
}

  • 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.