PHP code example of cblink / region

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

    

cblink / region example snippets


use Cblink\Region\Region;

$region = new Region();

$region->allProvinces(); // 全部省份
$region->allCities(); // 全部城市
$region->allAreas(); // 全部区
$region->nest($id = null); // 展示全部子区域,可指定某个省或市id
$region->nestFromChild($id); // 根据市或区id展示其所有父结构