Class EmailUtils { /** 判断给定的字符是否为Email字符. */ public static function isEmailChar($char) { return eregi("[a-zA-Z0-9\.\_\@]", $char); } } //end of class
类内部使用静态方法: self::isEmailChar($str);
类外部使用静态方法: EmailUtils ::isEmailChar($str);
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.