$content = str_replace("[url=","<a href=",$content);
$content = str_replace("]",">",$content);
$content = str_replace("[/url]","</a>",$content);
after your first pass it will look like this:
<a href="link...."]text[/url]
after your 2nd pass it will look like
<a href="link...">text[/url>
see the problem??
either make your third pass
$content = str_replace("[/url>","</a>",$content);
or switch the order of your 2nd and 3rd pass
hth