PHPackages                             zifan/addressparser - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zifan/addressparser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zifan/addressparser
===================

中文收货地址智能识别

v2.2.7(2y ago)471521MITPHPPHP &gt;=7.1

Since Aug 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/a443939412/address-parse)[ Packagist](https://packagist.org/packages/zifan/addressparser)[ Docs](https://github.com/a443939412/address-parse)[ RSS](/packages/zifan-addressparser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (14)Used By (1)

AddressParser
=============

[](#addressparser)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6da48bcb0c85d707805aeeab4e837620d0bd7d61164fe502055d1cdaa9ce1ee9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a6966616e2f616464726573737061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zifan/addressparser)[![Total Downloads](https://camo.githubusercontent.com/bf208b90a77e0bedb5afd48d550d436322992010c0e6f2d5ed4d1de312701f04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a6966616e2f616464726573737061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zifan/addressparser)[![Build Status](https://camo.githubusercontent.com/82b40e47287cd81b137db038f3e67938c6080716ced3f498242a9d2b6a495166/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7a6966616e2f616464726573737061727365722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/zifan/addressparser)[![StyleCI](https://camo.githubusercontent.com/cb13a877afd1dbe223c631789c3f922d3ace958fdb334a9cce9b26afefbc2ebd/68747470733a2f2f7374796c6563692e696f2f7265706f732f31323334353637382f736869656c64)](https://styleci.io/repos/12345678)

中文收货地址智能识别
----------

[](#中文收货地址智能识别)

参考链接：

-  感谢作者的分享
-

Take a look at [contributing.md](contributing.md) to see a to do list.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1.0
- Mbstring PHP Extension

Installation
------------

[](#installation)

Via Composer

```
$ composer require zifan/addressparser
```

Usage
-----

[](#usage)

$options = \['strict' =&gt; true\]

$parser = new AddressParser($options);

$parser-&gt;handle('浙江省杭州市滨江区西兴街道滨康路228号万福中心A座21楼');

Options
-------

[](#options)

Array $options Like:

```
[
    'dataProvider' => [
        'driver' => 'file'            // 驱动，默认file，其它方式（如数据模型）可自行扩展
        'path' => null,               // 指定省市区数据文件，默认从插件config文件夹中读取
    ],
    'enable_keywords_split' => false, // 是否启用关键词分割（适用于在淘宝、京东App上复制收货地址时开启，固定格式，拼多多不带关键字只是格式固定）
    'keywords' => [                   // enable_keywords_split 为 true 时才生效
        'person' => ['收货人', '收件人', '姓名'],
        'mobile' => ['手机号码', '手机', '联系方式', '电话号码', '电话'],
    ],
    'extra' => [                      // 额外提取字段
        'sub_district' => false,      // 村乡镇/街道（准确度低）
        'idn' => false,               // 身份证号
        'mobile' => false,            // 联系方式（手机号/座机号）
        'postcode' => false,          // 邮编
        'person' => false,            // 姓名（准确度低）
    ],
    'strict' => false,                // 是否对提取结果进行准确度校验、补齐
]
```

### 带关键字固定格式的收货地址示例

[](#带关键字固定格式的收货地址示例)

#### 京东格式

[](#京东格式)

姓名：张三
地址：浙江省杭州市滨江区 西兴街道 滨康路228号万福中心A座21楼

#### 淘宝格式

[](#淘宝格式)

收货人: 张三
手机号码: 158\*\*\*\*\*\*\*\*
所在地区: 浙江省杭州市滨江区西兴街道
详细地址: 滨康路228号万福中心A座21楼

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [zifan](https://github.com/a443939412)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

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

Every ~62 days

Recently: every ~85 days

Total

13

Last Release

992d ago

Major Versions

1.0.0 → 2.0.02021-08-23

PHP version history (2 changes)2.0.0PHP &gt;=7.0

v2.2.3PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/adc6b4a4ee23a86755a3e254a28e15b1b224049ec3e282a967dd2352d6da9df5?d=identicon)[a443939412](/maintainers/a443939412)

---

Top Contributors

[![a443939412](https://avatars.githubusercontent.com/u/13361366?v=4)](https://github.com/a443939412 "a443939412 (45 commits)")

---

Tags

address parseAddressParser

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zifan-addressparser/health.svg)

```
[![Health](https://phpackages.com/badges/zifan-addressparser/health.svg)](https://phpackages.com/packages/zifan-addressparser)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k234.7M20.6k](/packages/friendsofphp-php-cs-fixer)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[vaimo/composer-changelogs

Provide information about package changes based on changelog files that are bundled with releases; provide tools for generating documentation files from changelog sources

11150.5k10](/packages/vaimo-composer-changelogs)

PHPackages © 2026

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