PHP code example of nbczwphp / is-chinese-phone-number

1. Go to this page and download the library: Download nbczwphp/is-chinese-phone-number library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nbczwphp / is-chinese-phone-number example snippets


IsChinesePhoneNumber::check(phoneNumber: string | number, strict: boolean = false): boolean

use nbczwphp\isChinesePhoneNumber\IsChinesePhoneNumber;
IsChinesePhoneNumber::check('10086'); // ==> false
IsChinesePhoneNumber::check('18087030020'); // ==> true
IsChinesePhoneNumber::check('010-88888888'); // ==> true

IsChinesePhoneNumber::checkMobile(phoneNumber: string | number, strict: boolean = false): boolean

use nbczwphp\isChinesePhoneNumber\IsChinesePhoneNumber;
IsChinesePhoneNumber::checkMobile('10086') // ==> false
IsChinesePhoneNumber::checkMobile('18087030020') // ==> true
IsChinesePhoneNumber::checkMobile('010-88888888') // ==> false

IsChinesePhoneNumber::checkLandLine(phoneNumber: string | number, strict: boolean = false): boolean

use nbczwphp\isChinesePhoneNumber\IsChinesePhoneNumber;
IsChinesePhoneNumber::checkLandLine('10086') // ==> false
IsChinesePhoneNumber::checkLandLine('18087030020') // ==> false
IsChinesePhoneNumber::checkLandLine('010-88888888') // ==> true