Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
yingouqlj committed Mar 19, 2017
1 parent 0b28028 commit f54bdd9
Showing 1 changed file with 38 additions and 3 deletions.
41 changes: 38 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,48 @@
中华人民共和国统计局官网> 统计数据 > 统计标准 > 行政区划代码(定期我会更新)


用法


单个查找

```php
//根据编号查询
$region=RegionUtils::findByCode(310000);

//根据名称查询
$region=RegionUtils::findByTitle(上海市);
//返回 Region 类;

//取名称
$region->getName();
//取ID
$region->getId();
//取上级id
$region->getParentId();
//取名称
$region->getTitle();
//取省份
$region->getProvince();


```



取下级列表
```php
$regions=RegionUtils::listSubNode(310000);
//返回类型 Region[]

foreach($regions as $r){
//取ID
$r->getId();
//取上级id
$r->getParentId();
//取名称
$r->getTitle();
//取省份
$r->getProvince();
}



```

0 comments on commit f54bdd9

Please sign in to comment.