http://freephp.html.it/articoli/view...sp?id=69&pag=5
codice:$mail = "mail@sito.it"; echo eregi_replace("^([a-z0-9\._-]+)(@[a-z0-9\.-_]+)(\.{1}[a-z]{2,6})$", "<a href=\"mailto:\\1\\2\\3\">\\1\\2\\3</a>", $mail); function CodeUrl($link) { $Search = "^(https?|ftp)://([^<>[:space:]]+)$"; $Replace = "<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>"; return eregi_replace($Search, $Replace, $link); } // ESEMPIO DI UTILIZZO echo CodeUrl("http://www.html.it");

Rispondi quotando