Download the PHP package viison/address-splitter without Composer

On this page you can find all versions of the php package viison/address-splitter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package address-splitter

AddressSplitting

Packagist Build Status

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

Installation

This project can be installed via Composer:

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 & house number, respectively.

Example

You can use the address splitting service as follows:

The output of this command will be:

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 line additionToAddress1 streetName houseNumber base extension additionToAddress2
56, route de Genève route de Genève 56 56
Piazza dell'Indipendenza 14 Piazza dell'Indipendenza 14 14
Neuhof 13/15 Neuhof 13/15 13 15
574 E 10th Street E 10th Street 574 574
1101 Madison St # 600 Madison St 1101 1101 # 600
3940 Radio Road, Unit 110 Radio Road 3940 3940 Unit 110
D 6, 2 D 6 2 2
13 2ème Avenue 2ème Avenue 13 13
Apenrader Str. 16 / Whg. 3 Apenrader Str. 16 16 Whg. 3
Pallaswiesenstr. 57 App. 235 Pallaswiesenstr. 57 57 App. 235
Kirchengasse 7, 1. Stock Zi.Nr. 4 Kirchengasse 7 7 1. Stock Zi.Nr. 4
Wiesentcenter, Bayreuther Str. 108, 2. Stock Wiesentcenter Bayreuther Str. 108 108 2. Stock
244W 300N #101 W 300N 244 244 #101
Corso XXII Marzo 69 Corso XXII Marzo 69 69
Frauenplatz 14 A Frauenplatz 14 A 14 A
Mannerheimintie 13A2 Mannerheimintie 13A2 13 A2
Kerkstraat 13-HS Kerkstraat 13-HS 13 HS
Poststr. 15-WG2 Poststr. 15-WG2 15 WG2
Hollandweg1A Hollandweg 1A 1 A
Poststr. 2 1/2 Poststr. 2 1/2 2 1/2
Breitenstr. 13/15/8/6 Breitenstr. 13/15/8/6 13 13/15/8/6
Österreicher Weg 12A/8/6 Österreicher Weg 12A/8/6 12 A/8/6
Schegargasse 13-15/8/6 Schegargasse 13-15/8/6 13 15/8/6

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: https://regex101.com/r/vO5fY7/5

You can also run the tests via PHPUnit from the command line:

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

Further Information

The need for this functionality came up when we noticed that Shopware 5 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, 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.

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

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


All versions of address-splitter with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package viison/address-splitter contains the following files

Loading the files please wait ....