- function makeClickableLinks($text) {
- $text = eregi_replace('(((f|ht){1}<a href="tp://">tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)',
- '<a href="\\1">\\1</a>', $text);
- $text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)',
- '\\1<a href="<a href="http://">http://\\2">\\2</a>', $text);
- $text = eregi_replace('([_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})',
- '<a href="mailto:\\1">\\1</a>', $text);
- return $text;
- }
- //该片段来自于http://www.codesnippet.cn/detail/160120131702.html
来源: http://www.codesnippet.cn/detail/160120131702.html