I got the following BBCode code that perfectly fits the logic of what I need to create a link. But it has the following errors:
Warning: Unexpected character in input: '\' (ASCII = 92) state = 1 in /home/p3h8com/public_html/teste.php on line 3
Parse error: syntax error, unexpected ';' in /home/p3h8com/public_html/teste.php on line 3
$str = '[url=http://www.abc.com.br]Blog do Beraldo[/url]';
$str = preg_replace( "/\[url=(.*?)\](.*?)\[\/url\]/i", "<a href="\"$1\"" target="\"blank\"">$2</a>", $str );
echo $str;