help, im trying to convert bbcode to html code , and i keep getting this error
the bbcode is [url=link][attach]1[/attach][/url]
SCREAM: Error suppression ignored for( ! ) Warning: preg_replace(): Unknown modifier '/'
$content = $getThread['message'];
$bbUrl = '/\[url=(http|https|ftp)://{1}([a-zA-Z0-9/%@?:#&+._=-]*)\](.*?)\[/url\]/gixsm';
$htmlUrl = '<a href="{$1}://{$2}" target="_blank">{$3}</a>';
$atable = $thread->get_atable($tid);
$content = preg_replace($bbUrl, $htmlUrl, $content);
after the url done, will convert the [attach]1[/attach] again by using
$bbAttachment = 'etc...';
$htmlAttachment = 'etc...';
$content = preg_replace($bbAttachment, $htmlAttachment , $content);
Is this the correct way to do?
Appreciate for helping.
/with backslashes when using a foreslash as the pattern delimiter so they read\/.