I try to solve this but not got success so I need your help to convert it into preg_replace_callback,
its throw error like [14-Mar-2021 07:35:29 America/New_York] PHP Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bouracfj/public_html/staff/bbcode.php on line xx
function BBCODE($content){
$content = nl2br($content);
$match = array(
'#\[b\](.*?)\[\/b\]#se',
'#\[i\](.*?)\[\/i\]#se',
'#\[u\](.*?)\[\/u\]#se',
'#\[s\](.*?)\[\/s\]#se',
'#\[center\](.*?)\[\/center\]#se',
'#\[color=(.*?)\](.*?)\[\/color\]#se',
'#\[size=(.*?)\](.*?)\[\/size\]#se',
'#\[url=(.*?)\](.*?)\[\/url\]#se',
'#\[url\](.*?)\[\/url\]#se',
'#\[img\](.*?)\[\/img\]#se',
'#\[img h=(.*?) w=(.*?)\](.*?)\[\/img\]#se',
'#\[list\](.*?)\[\/list\]#se',
'#\[\*\](.*?)#se',
'#\[code\](.*?)\[\/code\]#se',
'#\[php\](.*?)\[\/php\]#se',
'#\[quote=(.*?)\](.*?)\[\/quote\]#se',
"':smile:'",
"':mad:'",
"':blush:'",
"':sad:'",
"':wink:'",
"':tounge:'",
"':grin:'",
"':laugh:'",
"':cry:'",
"':confused:'"
);
$replace = array(
"'<b>\\1</b>'",
"'<i>\\1</i>'",
"'<u>\\1</u>'",
"'<strike>\\1</strike>'",
"'<center>\\1</center>'",
"'<font color=\"\\1\">\\2</font>'",
"'<font size=\"\\1\">//2</font>'",
"'<a href=\"\\1\" target=\"_BLANK\">\\2</a>'",
"'<a href=\"\\1\" target=\"_BLANK\">\\1</a>'",
"'<img border=\"0\" src=\"\\1\">'",
"'<img border=\"0\" height=\"\\1\" width=\"\\2\" src=\"\\3\">'",
"'<ul>\\1</ul>'",
"'<li>\\1</li>'",
"'<u><b>Code:</b></u>
<div style=\"border: 1px dotted #000000; background-color: #CCCCCC; overflow: auto;\">\\1</div>'",
"'<u><b>PHP Code:</b></u>
<div style=\"border: 1px dotted #000000; background-color: #CCCCCC; overflow: auto;\">\\1</div>'",
"'<u><b>Quote:</b></u>
<div style=\"border: 1px dotted #000000; background-color: #CCCCCC; overflow: auto;\">Originally Posted By: <b>\\1</b><br />\\2</div>'",
"<img src=\"images/smile.gif\">",
"<img src=\"images/mad.gif\">",
"<img src=\"images/blush.gif\">",
"<img src=\"images/sad.gif\">",
"<img src=\"images/wink.gif\">",
"<img src=\"images/tongue.gif\">",
"<img src=\"images/biggrin.gif\">",
"<img src=\"images/laugh.gif\">",
"<img src=\"images/cry.gif\">",
"<img src=\"images/erm.gif\">"
);
$content = preg_replace($match, $replace, $content);
return $content;
}