
<? function make_clickable($text) { // pad it with a space so we can match things at the start of the 1st line. $ret = ' ' . $text; // matches an \"****x://yyyy\" URL at the start of a line, or after a space. // ****x can only be alpha characters. // yyyy is anything up to the first space, newline, comma, double quote or < $ret = preg_replace(\"#([trn ])([a-z0-9]+?){1}://([w-]+.([w-]+.)*[w]+(:[0-9]+)?(/[^ \"nrt<]*)?)#i\", '1<a href=\"2://3\" target=\"_blank\">2://3</a>', $ret); // matches a \"wwwŚftp.xxxx.yyyy[/zzzz]\" kinda lazy URL thing // Must contain at least 2 dots. xxxx contains either alphanum, or \"-\" // zzzz is optional.. will contain everything up to the first space, newline, // comma, double quote or <. $ret = preg_replace(\"#([trn ])(wwwŚftp).(([w-]+.)*[w]+(:[0-9]+)?(/[^ \"nrt<]*)?)#i\", '1<a href=\"http://2.3\" target=\"_blank\">2.3</a>', $ret); // matches an email@domain type address at the start of a line, or after a space. // Note: Only the followed chars are valid; alphanums, \"-\", \"_\" and or \".\". $ret = preg_replace(\"#([n ])([a-z0-9-_.]+?)@([w-]+.([w-.]+.)*[w]+)#i\", \"1<a href=\"mailto:2@3\">2@3</a>\", $ret); // Remove our padding.. return($ret); } ?>
a używam jej tak:
<? //... $tresc = make_clickable($tresc); //zmienna $tresc jest tutaj pobierana z bazy i na pewną są w niej linki takie jak ww.costam.pl, http://costam.pl/costam etc... //... ?>
i żaden z linków nie jest zmieniany

Proszę o jakąś wskazówkę jak zrobić żeby działało

Pozdr.