PHPackages                             nbczwphp/is-chinese-phone-number - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. nbczwphp/is-chinese-phone-number

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

nbczwphp/is-chinese-phone-number
================================

中国手机号码和电话号码校验验证，chinese phone mobile number

v1.0.0(4y ago)033MITPHPPHP &gt;=5.6.0

Since Mar 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/nbczw8750/is-chinese-phone-number)[ Packagist](https://packagist.org/packages/nbczwphp/is-chinese-phone-number)[ RSS](/packages/nbczwphp-is-chinese-phone-number/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

isChinesePhoneNumber
====================

[](#ischinesephonenumber)

中国电话号码验证函数。支持验证手机号码、座机号码。

背景资料：[使用 JavaScript 验证中国手机号码和座机号码](https://www.nickboy.cc/%E4%BD%BF%E7%94%A8-JavaScript-%E9%AA%8C%E8%AF%81%E4%B8%AD%E5%9B%BD%E6%89%8B%E6%9C%BA%E5%8F%B7%E7%A0%81%E5%92%8C%E5%BA%A7%E6%9C%BA%E5%8F%B7%E7%A0%81.html)

安装
--

[](#安装)

```
composer require nbczwphp/is-chinese-phone-number
```

使用
--

[](#使用)

### 验证中国电话号码

[](#验证中国电话号码)

语法：

```
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
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1630d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/299441?v=4)[nbczw8750](/maintainers/nbczw8750)[@nbczw8750](https://github.com/nbczw8750)

---

Top Contributors

[![nbczw8750](https://avatars.githubusercontent.com/u/299441?v=4)](https://github.com/nbczw8750 "nbczw8750 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nbczwphp-is-chinese-phone-number/health.svg)

```
[![Health](https://phpackages.com/badges/nbczwphp-is-chinese-phone-number/health.svg)](https://phpackages.com/packages/nbczwphp-is-chinese-phone-number)
```

###  Alternatives

[toplan/laravel-sms

A mobile phone number validation solution based on laravel

83580.2k2](/packages/toplan-laravel-sms)[drupal/coder

Coder is a library to review Drupal code.

3046.8M629](/packages/drupal-coder)[ph-7/eu-vat-validator

A simple and clean PHP class that validates EU VAT numbers against the central ec.europa.eu database (using the official europa API).

97510.7k1](/packages/ph-7-eu-vat-validator)[hyperf/validation

hyperf validation

122.2M213](/packages/hyperf-validation)[udokmeci/yii2-phone-validator

Modern Yii2 Phone validator wrapper on top of PhoneNumberUtil library also used by Android devices

36227.5k1](/packages/udokmeci-yii2-phone-validator)[snowcap/vat-validation

EU VAT number validation

10112.3k](/packages/snowcap-vat-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
