一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

php 邮件验证与图片正则表式程序

时间:2009-12-09 编辑:简简单单 来源:一聚教程网

php 邮件验证与图片正则表式程序

function emailcheck($email)
{
 $ret = false;

 if(strstr($email, '@') && strstr($email, '.'))
 {
  if(preg_match("/^([_a-z0-9]+([._a-z0-9-]+)*)@([a-z0-9]{1,}(.[a-z0-9-]{2,})*.[a-z]{2,4})$/i", $email))
   $ret = true;
  if(strlen($email) < "8" || strlen($email) > "80")
   $ret = false;
 }

 return $ret;
}


preg_match_all('/[img](.+?)[/img]/is', $str, $img);

preg_match_all('/[video](.+?)[/video]/is', $str, $video);

热门栏目