Posted by Brian Mansell on 05/30/06 06:20
This should be able to handle converting urls to links... function text_to_link_conversion($text) { $text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '\\1<a href="http://\\2">\\2</a>', $text); $text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '<a href="\\1">\\1</a>', $text); return $text; }
[Back to original message]
Copyright © 2005-2006 Powered by Custom PHP Programming