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);

相关文章

精彩推荐