PHP and MySQL – storing quotes

The best way to store quotes htmlentities($campaignsubject, ENT_QUOTES|ENT_SUBSTITUTE|ENT_HTML401); And to decode it back use html_entity_decode($rowsCampaigns[‘content’],ENT_QUOTES|ENT_SUBSTITUTE|ENT_HTML401);

PHP determine masked string

Here is a preg_match expression for finding if a string contains a certain set of repeated characters, say like the masking characters in a stored credit number or say a hidden phone number if(preg_match(“/x{5,12}/”,”THE STRING”))  // if there are 12 consecutive x in the string, starting from position 6