Hello this is the complete code
which should replace bbcode quotation
These look like this:
[quote:2342423="somename"]some text [/quote]
$uid=2342423;
This is the code which does not work:
$text=preg_replace("/(\[(?i)quote:".$uid."=\")(.*?)(\"\])(.*?)(\[\/(?i)quote:".$uid."\])/", "<br /> <table width=\"90%\" cellspacing=\"1\" cellpadding=\"3\" border=\"1\" align=\"center\"><tr><td>\$2 wrote:</td></tr><tr><td class=\"quote\"><quote>\$4</quote> </td></tr></table> <br />", $text);
This code works, but it does not look as I want it as it displays the apostrophes so I want to match the apostrophe:
$text=preg_replace("/(\[(?i)quote:".$uid."=)(.*?)(\])(.*?)(\[\/(?i)quote:".$uid."\])/", "<br /> <table width=\"90%\" cellspacing=\"1\" cellpadding=\"3\" border=\"1\" align=\"center\"><tr><td>\$2 wrote:</td></tr><tr><td class=\"quote\"><quote>\$4</quote> </td></tr></table> <br />", $text);