$patterns = array("/\[url\](.*)\[\/url\]/", "/\s(f|ht)(tps?:\/\/)(\S*)/", "/\[url=(.*)\](.*)\[\/url\]/");
$replaces = array("<a href=\"\\1\">\\1</a>", " <a href=\"\\1\\2\\3\">\\1\\2\\3</a>", "<a href=\"\\1\">\\2</a>");
$string = preg_replace($patterns, $replaces, $string);
Hi,
Can some one help me to make the above working for
www.yahoo.com (without [url]http://[/url])?
Thanks
Ahmad
Hong Kong