php专区

 首页 > php专区 > PHP应用 > php函数大全 > Email URL的判断和自动转换函数

Email URL的判断和自动转换函数

分享到:
【字体:
导读:
          function validateEmail($email){ return eregi("^[_a-z0-9-] ( [_a-z0-9-] )*@[a-z0-9-] ( [a-z0-9-] )*( [a-z]{2,3})$", $email);}function validateURL($url){ return eregi("^((ht|f)tp: )((([a

 

function validateEmail($email)
{ return eregi("^[_a-z0-9-] (.[_a-z0-9-] )*@[a-z0-9-] (.[a-z0-9-] )*(.[a-z]{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://www.|www.)([a-z0-9-] (.[a-z0-9-] )*(.[a-z]{2,3})((/|?)[a-z0-9~#%&/'_ =:?.-]*)*)", "http://www.3", $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~#%&'_ =:?.-]*)*)", "

分享到:
PHP中的DOMXML函数
  DOM XML functions These functions are only available if PHP was configured with --with-dom=[DIR], using the GNOME xml library. You will need at least libxml-2.0.0 (the beta version will not work). These functions have been added in PHP4. This module defines the following constants: Table 1. X...
用PHP或JS获取图片大小、高宽尺寸
  $arr=getimagesize("images/album_01.gif"); echo $arr[3]; $strarr=explode(""",$arr[3]); echo $strarr[1]; ?> function Wa_SetImgAutoSize(img){//var img=document.all.img1;//获取图片var MaxWidth=200;//设置图片宽度界限var MaxHeight=100;//设置图片高度界限var HeightWidth=img.offsetHeight/img.offse...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……