PHP code example of tinson / tool

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

    

tinson / tool example snippets




use Tinson\Tool\AddressSeparator.php

//分离地址姓名、电话、邮编和省市区详细地址
$str = "张三,13001277920  335500  大理胡人街道八大胡同42号";
$arr = AddressSeparator::getInstance()->handle($str);
var_dump($arr);

//省市区详细地址
$address = "云南大理胡人街道八大胡同42号";
$arr = AddressSeparator::getInstance()->handleAddress($address);
var_dump($arr);




use Tinson\Tool\Validate;

date_default_timezone_set('Asia/Chongqing');
$rootPath = __DIR__;