Skip to content
Advertisement

Find and replace emails and phone numbers in PHP

I was hoping for a little help on this, as it’s confusing me a little… I run a website that allows users to send messages back and forth, but on the inbox i need to hide both emails and phone numbers.

Example: This is how a sample email would look like.

Hi, my phone is +44 5555555 and email is jack@jack.com

I need it to be like this:

Hi, my phone is (phone hidden) and email is (email hidden)

Do you have any ideas ?… I really appreciate it!..

Advertisement

Answer

JavaScript

kudo’s for the phonenumber regex to fatcat

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement