PHP code example of alapi / address_parse

1. Go to this page and download the library: Download alapi/address_parse 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/ */

    

alapi / address_parse example snippets


use ALAPI\AddressParse;

se();

$address = "北京 北京市 顺义区 胜利街道宜宾南区2-2-401 李俊南 18210997754";

print_r($parse->setType(1)->parse($address));

use ALAPI\AddressParse;

$parse = new AddressParse();

$address = "北京 北京市 顺义区 胜利街道宜宾南区2-2-401 李俊南 18210997754";

$parse->setType(1)->parse($address); #正则解析,type 为 1

$parse->setType(2)->parse($address); #树查找解析, type 为2