PHPackages                             viison/address-splitter - 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. viison/address-splitter

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

viison/address-splitter
=======================

Tries to split an address line into street name, house number and other additional information like building, apartment information etc.

0.3.4(6y ago)1034.6M↑10.1%22[13 issues](https://github.com/VIISON/AddressSplitting/issues)[1 PRs](https://github.com/VIISON/AddressSplitting/pulls)10MITPHPPHP &gt;=5.3.2CI failing

Since Apr 23Pushed 4y ago10 watchersCompare

[ Source](https://github.com/VIISON/AddressSplitting)[ Packagist](https://packagist.org/packages/viison/address-splitter)[ RSS](/packages/viison-address-splitter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (12)Used By (10)

AddressSplitting
================

[](#addresssplitting)

[![Packagist](https://camo.githubusercontent.com/be162fe5f3e66e3a7064fac045910c52f9e822f90a8ecdf49ae554721f99cb34/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766969736f6e2f616464726573732d73706c69747465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/viison/address-splitter) [![Build Status](https://camo.githubusercontent.com/51b6ea30af52045c8e9af643fc9a0c056d59a94f1b6736803b25b2fbb1769065/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f564949534f4e2f4164647265737353706c697474696e672e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/VIISON/AddressSplitting) [![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Tries to split an address line into street name, house number and other additional information like building, apartment information etc.

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

[](#installation)

This project can be installed via [Composer](https://getcomposer.org/):

```
$ composer require viison/address-splitter
```

Usage
-----

[](#usage)

The AddressSplittingService only contains one static function `splitAddress` that performs the address splitting. The function expects one parameter, which is the address line. The function returns an associative array with the keys `additionToAddress1`, `streetName`, `houseNumber` and `additionToAddress2`. `additionToAddress1` and `additionToAddress2`contain information given in front of or after the street name &amp; house number, respectively.

Example
-------

[](#example)

You can use the address splitting service as follows:

```
var_dump(\VIISON\AddressSplitter\AddressSplitter::splitAddress('Pallaswiesenstr. 57B App. 235'));
```

The output of this command will be:

```
array(4) {
	["additionToAddress1"]=>
	string(0) ""
	["streetName"]=>
	string(16) "Pallaswiesenstr."
	["houseNumber"]=>
	string(2) "57B"
	["houseNumberParts"]=> array(2) {
	    ["base"]=>
	    string(2) "57"
	    ["extension"]=>
	    string(1) "B"
	}
	["additionToAddress2"]=>
	string(8) "App. 235"
}
```

Supported Address Formats
-------------------------

[](#supported-address-formats)

We try to support all address formats used world-wide. E.g., the address splitter will work no matter if the house number is given in front of or after the street name.

Here is a number of examples of addresses and how their splitted representation looks like:

Address lineadditionToAddress1streetNamehouseNumberbaseextensionadditionToAddress256, route de Genèveroute de Genève5656Piazza dell'Indipendenza 14Piazza dell'Indipendenza1414Neuhof 13/15Neuhof13/151315574 E 10th StreetE 10th Street5745741101 Madison St # 600Madison St11011101\# 6003940 Radio Road, Unit 110Radio Road39403940Unit 110D 6, 2D 62213 2ème Avenue2ème Avenue1313Apenrader Str. 16 / Whg. 3Apenrader Str.1616Whg. 3Pallaswiesenstr. 57 App. 235Pallaswiesenstr.5757App. 235Kirchengasse 7, 1. Stock Zi.Nr. 4Kirchengasse771. Stock Zi.Nr. 4Wiesentcenter, Bayreuther Str. 108, 2. StockWiesentcenterBayreuther Str.1081082. Stock244W 300N #101W 300N244244\#101Corso XXII Marzo 69Corso XXII Marzo6969Frauenplatz 14 AFrauenplatz14 A14AMannerheimintie 13A2Mannerheimintie13A213A2Kerkstraat 13-HSKerkstraat13-HS13HSPoststr. 15-WG2Poststr.15-WG215WG2Hollandweg1AHollandweg1A1APoststr. 2 1/2Poststr.2 1/221/2Breitenstr. 13/15/8/6Breitenstr.13/15/8/61313/15/8/6Österreicher Weg 12A/8/6Österreicher Weg12A/8/612A/8/6Schegargasse 13-15/8/6Schegargasse13-15/8/61315/8/6Unit Tests
----------

[](#unit-tests)

The examples above and even more exemplary address lines are part of our unit tests. The unit tests can be run on the following site:

You can also run the tests via [PHPUnit](https://phpunit.de/) from the command line:

```
$ phpunit

```

If you don't have PHPUnit installed globally, run `composer install` first.

Further Information
-------------------

[](#further-information)

The need for this functionality came up when we noticed that [Shopware 5](https://github.com/shopware/shopware) does not contain individual fields for the street name and the house number anymore. Nevertheless, we needed to have these separated for our [DHL Adapter](http://store.shopware.com/viison00656/dhl-adapter.html), because the DHL API expects them to be passed individually.

More background information on how this implementation came together can be found in our [blog post](http://blog.viison.com/post/115849166487/shopware-5-from-a-technical-point-of-view#address-splitting).

Adresstrennung
==============

[](#adresstrennung)

Dieses Projekt ermöglicht es, eine Adresszeile in Straßennamen und Hausnummer sowie weitere Angaben wie z.B. Gebäude- oder Appartmentinformationen zu trennen. Unterstützt werden eine Vielzahl an Adressformaten, wie sie weltweit verwendet werden. So ist es z.B. unerheblich, ob die Hausnummer auf die Straße folgt oder ihr voran steht.

License
-------

[](#license)

**viison/address-splitter** is licensed under the MIT license. See the `LICENSE` file for more details.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity59

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~182 days

Recently: every ~198 days

Total

10

Last Release

2399d ago

### Community

Maintainers

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

---

Top Contributors

[![andrewisplinghoff](https://avatars.githubusercontent.com/u/105166?v=4)](https://github.com/andrewisplinghoff "andrewisplinghoff (12 commits)")[![svenmuennich](https://avatars.githubusercontent.com/u/1932115?v=4)](https://github.com/svenmuennich "svenmuennich (12 commits)")[![cjuner](https://avatars.githubusercontent.com/u/4528060?v=4)](https://github.com/cjuner "cjuner (6 commits)")[![bcremer](https://avatars.githubusercontent.com/u/55820?v=4)](https://github.com/bcremer "bcremer (4 commits)")[![windaishi](https://avatars.githubusercontent.com/u/6232639?v=4)](https://github.com/windaishi "windaishi (3 commits)")[![emilv](https://avatars.githubusercontent.com/u/1684914?v=4)](https://github.com/emilv "emilv (2 commits)")

---

Tags

shopware5shopware6

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/viison-address-splitter/health.svg)

```
[![Health](https://phpackages.com/badges/viison-address-splitter/health.svg)](https://phpackages.com/packages/viison-address-splitter)
```

###  Alternatives

[ergebnis/clock

Provides abstractions of a clock.

301.2M](/packages/ergebnis-clock)[bandwidth-throttle/bandwidth-throttle

Bandwidth throttle at application layer

87139.3k](/packages/bandwidth-throttle-bandwidth-throttle)

PHPackages © 2026

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