My website blew up recently because the eregi_replace got phased out. Now I need to convert them into a preg_replace or something else. This worked with most of my functions but I'm having trouble with the ones that simulate bbtags.
Could someone help?
$txt = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $txt);
$txt = eregi_replace("\\[img\\]([^\\[]*)\\[/img\\]", "<a href=\"\\1\"><img src=\"\\1\" width=\"150px\" height=\"150px\" style=\"float: left; margin-right: 10px;\" /></a>", $txt);
$txt = eregi_replace("\\[cimg\\]([^\\[]*)\\[/cimg\\]", "<a href=\"\\1\"><img src=\"\\1\" width=\"100px\" height=\"100px\" /></a>", $txt);
$txt = eregi_replace("\\[code\\]([^\\[]*)\\[/code\\]", "<br><br><strong>Code:</strong><table width=\"80%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#FFFFFF\" style=\"border:1px solid gray;\"><tr><td bgcolor=\"#FFFFFF\"><font color=\"#009900\" size=\"-2\">\\1</font></td></tr></table><br>", $txt);