A simple question: Is this the best way to do it?
$pattern1 = \"regexp1\";
$pattern2 = \"regexp2\";
$pattern3 = \"regexp3\";
$content = preg_replace($patter
I am using it for XML tags string.
Ahmad Maarop CJ, Zaharah Ibrahim , Prasad Sandosham , Jeffrey Tan , Alizatul Khair FCJJ\r\n';
$patterns = array('/\bCJ\b/', '/\bJCA\b/','/\bJJCA\b/','/\bPCA\b/', '/\bCJM\b/', '/\bCJSS\b/', '/\bFCJ\b/', '/\bFCJJ\b/', '/\bJ\b/','/\bH\b/', '/\bPK\b/','/\bJC\b/', '/\bHMP\b/', '/\bHHMP\b/', '/\bHMR\b/', '/\bHHMR\b/');
$replacements = array('CJ ', 'JCA ','JJCA ','PCA ', 'CJM ', 'CJSS ', 'FCJ ', 'FCJJ ', 'J ','H ', 'PK ','JC ', 'HMP ', 'HHMP ', 'HMR ', 'HHMR ');
$string = preg_replace($patterns,$replacements,$xmlString);
echo $string;
// Ahmad Maarop CJ , Zaharah Ibrahim , Prasad Sandosham , Jeffrey Tan , Alizatul Khair FCJJ \r\n ◀
?>