I am using cakephp. And I have a textarea field where users insert data, I use the tinymce plugin to format the text. I warned users not to enter a phone number or email address inside the text box. But I do not want to risk it.
Is there a way to get the phone number and email from the text box and replace it with something like XXXX@gmail.com ..
I appreciate any help.
Thank.
Something is wrong here to replace the email address with a hidden one:
$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);
, , . ( ) http://www.regexlib.com/ preg_replace.
: $string = "blabla@blablabla.com";
$string = "blabla@blablabla.com";
$parts = explode("@",$string);
\\$parts[0] contains the local part
\\$parts[1] contains the domain.
, ( ), , RFC 822, "@" . : "bl @bla" @blablabla.com .
Source: https://habr.com/ru/post/1772134/More articles:Is SQL table alias ambiguity prohibited by standard or blocked by implementations? - sqlТребуется ли более высокая настройка вызовов для защищенных веб-служб (HTTPS)? - securityC # - convert byte [] to string in Windows 7 Phone - c #When developing something in OO - javajquery onclick click event - jquerySorting procedure results in SQL Server 2008 - sqlREST-based HTTP API - should I use WCF? - httpWorking with part of a request at a time - javaPreventing Execution of CommandManager WPF Using CanExecute - wpfDelphi / Tesseract OCR: Can someone help me get this new DLL working in Delphi? - dllAll Articles