Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3301862
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:47:37+00:00 2026-05-17T20:47:37+00:00

I am using cakephp. And I have textarea field where users paste data, I

  • 0

I am using cakephp. And I have textarea field where users paste data, I using tinymce plugin to format text. I have warned users not to enter telephone number or email address inside the textarea. But, I dont want to take chances.

Is there a way I can extract the telephone number and email from textarea and replace it something like XXXX@gmail.com..

I appreciate any help.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T20:47:38+00:00Added an answer on May 17, 2026 at 8:47 pm

    Here’s something off the top of my head for replacing the e-mail address with hidden:

    $str = "My e-mail is shown@gmail.com Contact me for more details";
    $str = preg_replace("/([a-zA-Z0-9\._]+)(@[a-zA-Z0-9\-\.]+)/", "hidden\\2", $str);
    print($str);
    

    The e-mail regex is not the best, but it’s something that works for your example. You can get more interesting regexes (emails and phone numbers) at http://www.regexlib.com/ and use them with a simple preg_replace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using cakephp 1.3 and I have textarea where users submit articles. On
I am using cakephp with php, I have table with field id having data
Im using cakephp 2.0 and i have data submitted that i want to cleanup,
I have trouble saving my date field into database using CakePHP. Table column name
I am using cakePHP rating plugin with Flowplayer. I have customized the Flowplayer using
I am using CakePHP 2.0 and I have a many-to-many relationship betweens users and
I am using Cakephp 1.3.6 and I have installed gigya plugin as per instructions.
I'm using CakePHP 1.3.8, and I've installed the CakeDC Search plugin . I have
I have only recently started using CakePHP and have been unable to get validation
I'm using cakephp 2.1.3 and I have a table Ingredients and a table IngredientAliases

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.