Page 1 of 1

Agile Seller Messages - Option to Remove Phone & Emails

PostPosted: Sat Jan 14, 2017 9:29 pm
by carlo.macis_15320
Add an option to choose to remove phone and email addresses from messages

Code: Select all
function removeEmailAndPhoneFromString($string) {
   // remove email
   $string = preg_replace('/([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/','',$string);
   
   // remove phone
   $string = preg_replace('/([0-9]+[\- ]?[0-9]+)/','',$string);
   
   return $string;
}

echo removeEmailAndPhoneFromString('Lorem ipsum [email protected] dolor sit amet, 37011116546 consectetur adipiscing elit.');


Re: Agile Seller Messages - Option to Remove Phone & Emails

PostPosted: Sun Jan 15, 2017 2:35 am
by shokinro
Thanks for your suggestion and contribution.
I will make sure it will be included in the next version of the module.