How to hide an Email in a text file *

Source: Internet
Author: User
How can I hide the email address in the following text? $ Str & #039; Chinese character is scddtest001@qq.comasdatest002 @ qq.com after you amtest009@aa.com last mailbox defse@ff.com & #039; the expected result is: {code ...} how can I hide the email address in the following text?
$ Str = 'character is scdd test001@qq.com asda test002@qq.com after you am test009@aa.com last mailbox defse@ff.com ';
Expected results:

The Chinese character is scdd ******** @ qq.com asda ******** @ qq.com your post am ******** @ aa.com's last mailbox ** * ** @ ff.com

Reply content:

How can I hide the email address in the following text?
$ Str = 'character is scdd test001@qq.com asda test002@qq.com after you am test009@aa.com last mailbox defse@ff.com ';
Expected results:

The Chinese character is scdd ******** @ qq.com asda ******** @ qq.com your post am ******** @ aa.com's last mailbox ** * ** @ ff.com

$ Str = 'character is scdd test001@qq.com asda test002@qq.com your post am test009@aa.com last mailbox defse@ff.com '; $ replace = "*"; echo preg_replace_callback ('/([a-zA-Z0-9] *) @ ([a-zA-Z0-9] * \. com)/', function ($ matches) use ($ replace) {return str_repeat ($ replace, strlen ($ matches [1]). "@". $ matches [2] ;}, $ str );

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.