I am trying to use the preg_replace for following statement and it's not working correctly
here, $arrcontents is array of reserved words and in $buffer, file needs to read and high light all that reserved words
I want to replace all reserved words which starts from . or = or whitespace or { or { like that...
Help me please!!
for ($i=0;$i<sizeof($arrcontents);$i++){
$buffer = preg_replace("/\.|(|[|=|{|}|]|) . trim($arrcontents[$i])/" , "<b><font color='#0000ff'>" . trim($arrcontents[$i]) . "'</b></font>", $buffer);;
echo "BUFFER: $buffer";
exit;
}
Dev