dio Posted May 5, 2004 Report Posted May 5, 2004 kāds var pateikt skriptu, lai komentāros ierakstīta adrese kļūtu par saiti?
Venom Posted May 5, 2004 Report Posted May 5, 2004 Izmanto G2G modeli (go 2 google): reqular expression for matching links in text (comments)
zOndE Posted May 6, 2004 Report Posted May 6, 2004 $patterns = array ( "/(http\:\/\/[^\s]+)/i", "/(ftp\:\/\/[^\s]+)/i", "/(mailto\:([^\s]+))/i", "/\__(.+)\__/i", ); $replace = array ( "<a href=\"\\1\" target=\"_blank\">\\1</a>", "<a href=\"\\1\" target=\"_blank\">\\1</a>", "<a href=\"\\1\" target=\"_blank\">\\2</a>", "<b>\\1</b>", ); $text = preg_replace($patterns,$replace, $text); shaadi piemeram ...
rumpels Posted May 14, 2004 Report Posted May 14, 2004 atradu vel vienu un negribas kliegt baigi bet liekas bus pilnveidigaks http://php.ogreland.lv/snippets/1.phps
Recommended Posts