<?php
class check{
	//验证是否email
	public static function is_email($email=''){
		return strlen($email) > 6 && strlen($email) <= 32 && preg_match("/^([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-]+[.][A-Za-z0-9\-.]+)$/", $email);
	}
	//手机号合法性验证
	public static function is_mobile($mobile = ''){
		if( preg_match("/^1[34578][0-9]{9}$/",$mobile) ){
			return true;
		}else{
			return false;
		}
	}
    public static function is_mobile_bak($num) {
        if (!$num) {
            return false;
        }
        return preg_match('#^13[\d]{9}$|14^[0-9]\d{8}|^15[0-9]\d{8}$|^18[0-9]\d{8}$#', $num) ? true : false;
    }
	//验证URL
	public static function is_url($url = ''){
		if( preg_match("/^(\w+:\/\/)?\w+(\.\w+)+.*$/",$url) ){
			return true;
		}else{
			return false;
		}
	}
	//验证QQ
	public static function is_qq($qq = 0){
		if(preg_match("/^[1-9][0-9]{4,11}$/",$qq)){
			return true;
		}else{
			return false;
		}
	}
}
