//Url mit Bild - http:// in der url vorhanden - url außerhalb von[url]
$content = preg_replace("#\[url\]http://(.*?)\[img\]http://(.*?)\[/img\]\[/url\]#si", "<a href=\"http://\\1\" target=\"_blank\"><img src=\"http://\\2\" border=\"0\"></a>", $content);
//Url mit Bild - http:// nicht vorhanden - url außerhalb von[url]
$content = preg_replace("#\[url\]www.(.*?)\[img\]www.(.*?)\[/img\]\[/url\]#si", "<a href=\"http://www.\\1\" target=\"_blank\"><img src=\"http://www.\\2\" border=\"0\"></a>", $content);
//Url mit Bild - http:// in der url vorhanden - url innerhalb von [url]
$content = preg_replace("#\[url=http://(.*?)\]\[img\]http://(.*?)\[/img\]\[/url\]#si", "<a href=\"http://\\1\" target=\"_blank\"><img src=\"http://\\2\" border=\"0\"></a>", $content);
//Url mit Bild - http:// nicht vorhanden - url innerhalb von [url]
$content = preg_replace("#\[url=www.(.*?)\]\[img\]www.(.*?)\[/img\]\[/url\]#si", "<a href=\"http://www.\\1\" target=\"_blank\"><img src=\"http://\\2\" border=\"0\"></a>", $content);
//Url http vorhanden adresse außerhalb von [url]
$content = preg_replace("#\[url\]http://(.*?)\[/url\]#si", "<a href=\"http://\\1\" target=\"_blank\">\\1</a>", $content);
//Url http nicht vorhanden, www vorhanden adresse außerhalb von [url]
$content = preg_replace("#\[url\]www.(.*?)\[/url\]#si", "<a href=\"http://\\1\" target=\"_blank\">http://www.\\1</a>", $content);
//Url mit http im [url] tag
$content = preg_replace("#\[url=http://(.*?)\](.*?)\[/url\]#si", "<a href=\"http://\\1\" target=\"_blank\">\\2</a>", $content);
//Url mit www im [url] tag
$content = preg_replace("#\[url=www.(.*?)\](.*?)\[/url\]#si", "<a href=\"http://www.\\1\" target=\"_blank\">\\2</a>", $content);
//Url ohne www im [url] tag
$content = preg_replace("#\[url=(.*?)\](.*?)\[/url\]#si", "<a href=\"\\1\">\\2</a>", $content); // relativer link
//alle anderen angaben mit [url] tags
$content = preg_replace("#\[url\](.*?)\[/url\]#si", "<a href=\"\\1\">\\1</a>", $content); // relativer link
//automatische Umwandlung zu url wenn kein [url] vorhanden
$content = preg_replace("#(^|[^\"=]{1})(http://|https://|ftp://|mailto:|news:)([^\s<>]+)([\s\n<>]|$)#sm","\\1<a href=\"\\2\\3\" target=\"_blank\">\\3</a>\\4",$content);