澳门新浦京8455comEmail+URL的判断和自动转换函数

?php function validateEmail($email) {return
eregi(“^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]澳门新浦京8455com,{2,3})$”,
$email); } function validateURL($url) {return
eregi(“^((ht|f)tp://)((([a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3}))|(([0-9]{1,3}.){3}([0-9]{1,3})))((/|?)[a-z0-9~#%_+=:?.-]*)*)$”,
$url); } function convertURLS($text) {$text =
eregi_replace(“((ht|f)tp://|)([a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})((/|?)[a-z0-9~#%/_+=:?.-]*)*)”,
“”, $text); $text =
eregi_replace(“((ht|f)tp://)((([a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3}))|(([0-9]{1,3}.){3}([0-9]{1,3})))((/|?)[a-z0-9~#%_+=:?.-]*)*)”,
“a href=”

You can leave a response, or trackback from your own site.

Leave a Reply

网站地图xml地图