PHP求字符串的长度 部分正则表达式
function strLength($string){ $array = preg_split("/(?<!^)(?!$)/u",$string); return count($array); } 固话 $result = preg_match("/^(0(10|21|22|23|[1-9][0-9]{2})(-|))?[0-9]{7,8}$/", $phone,$match); 移动电话 $result = preg_match("/^(((d{3}))|(d{3}-))?1d{10}$/", $phone,$match); 邮箱 strlen($email) > 6 && preg_match("/^[w-.]+@[w-]+(.w+)+$/", $email) URL地址 preg_match("/^http://[A-Za-z0-9]+.[A-Za-z0-9]+[/=?%-&_~`@[]":+!]*([^<>"])*$/", $str);
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。