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