Summary of usage of mobile phone number verification instances in php

Source: Internet
Author: User
Tags php regular expression
Copy the code as follows:

1. php mobile phone number verification (supporting local query and encoding UTF8) _ PHP Tutorial

Description: php verifies the mobile phone number (which can be found by region and encoded as UTF8 ). The code is as follows :? Php // mobile phone number verification function checkMobileValidity ($ mobilephone) {$ exp = "/^ 13 [0-9] {1} [0-9] {8} $ | 15 [012356789] {1} [0-9] {8} $ | 18 [012356789] {1} [0-9] {8} $ | 14 [

2. php regular expression verification-PHP mobile phone number verification (, 18)

Introduction: php regular expression verification-PHP mobile phone number verification (, 18)

3. verify the mobile phone number in php (the local query and encoding are supported as UTF8)

Introduction: This article will implement the following functions: mobile phone number verification/conversion string encoding to UTF8. if you are interested in this, please refer to, maybe this article will help you

4. find the js code to verify the mobile phone number entered by the user and pass in the background code

Introduction: The front-end page is as follows {code ...} the method bit sendVerifyMessage is sent in the background. the corresponding route is domain/send-verify-message. the js code can verify the mobile phone number entered by the user and pass in the background code.

5. verify the mobile phone number in php to determine the location of the mobile phone number

Introduction :? Php // mobile phone number verification function checkMobileValidity ($ mobilephone) {$ exp =/^ 13 [0-9] {1} [0-9] {8} $ | 15 [012356789] {1} [0-9] {8} $ | 18 [012356789] {1} [0-9] {8} $ | 14 [57] {1} [0-9] $ /; if (preg_match ($ exp, $ mobilephone) {return true;} else {return false;} // return the mobile phone number

6. PHP mobile phone number verification function (, 18)

Introduction: no details, no/*** verify whether it is a mobile phone number ** @ param string $ phone number to be verified * @ return boolean if verification fails, false is returned, returns true */function isTelNumber ($ phone) {if (strlen ($ phone )! = 11 |! Preg_match ('/^ 1 [3 | 4 | 5 | 7 | 8] [0-9] d {4, 8} $

7. php mobile phone number verification (supports local location query and UTF-8 encoding) _ php skills

Introduction: This article will implement the following functions: mobile phone number verification/conversion string encoding to UTF8. if you are interested in this, please refer to, maybe this article will help you

The above is a summary of the usage of mobile phone number verification instances in php. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.