function makeClickableLinks($text) {
$text = eregi_replace('(((f| ht){1}tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)', '
1< /a>', $text);
$text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+. ~#?&//=]+)','12', $text);
$text = eregi_replace('([_ .0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})', '
1', $text);
return $text;
}
mainly uses the regular principle to match URL characters or Email to replace it with a hyperlink.