storbukas/postnummer 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

storbukas/postnummer

Composer 安装命令:

composer require storbukas/postnummer

包简介

Norske postnummer - Norwegian postal codes

README 文档

README

Tests Latest Version PHP Version License

Norske postnummer - Norwegian postal codes for PHP

Installation

composer require storbukas/postnummer

Usage

use Storbukas\Postnummer\Postnummer;

// Get place name
Postnummer::poststed('4633');      // 'KRISTIANSAND S'
Postnummer::poststed('1337');      // 'SANDVIKA'
Postnummer::poststed(4879);        // 'GRIMSTAD'
Postnummer::poststed('9999');      // null

// Get municipality name
Postnummer::kommunenavn('4633');   // 'KRISTIANSAND'

// Get municipality number
Postnummer::kommunenummer('4633'); // '4204'

// Get category
Postnummer::kategori('4633');      // 'G'

// Get full info
Postnummer::get('4633');
/*
[
    'poststed' => 'KRISTIANSAND S',
    'kommunenummer' => '4204',
    'kommunenavn' => 'KRISTIANSAND',
    'kategori' => 'G',
]
*/

// Check if postal code exists
Postnummer::exists('4633');        // true
Postnummer::exists('9999');        // false

// Search by place or municipality name
Postnummer::search('KRISTIANSAND');
/*
[
    '4608' => ['poststed' => 'KRISTIANSAND S', ...],
    '4609' => ['poststed' => 'KARDEMOMME BY', ...],
    '4610' => ['poststed' => 'KRISTIANSAND S', ...],
    ...
]
*/

// Get all postal codes
$all = Postnummer::all();

API

Method Returns Description
get($postnummer) ?array Full postal code info or null
poststed($postnummer) ?string Place name or null
kommunenavn($postnummer) ?string Municipality name or null
kommunenummer($postnummer) ?string Municipality number or null
kategori($postnummer) ?string Category or null
exists($postnummer) bool Whether postal code exists
search($query) array Matching postal codes
all() array All postal codes

Categories

Code Description
B Both street addresses and PO boxes
F Multiple use
G Street addresses only
P PO boxes only
S Service postal codes

Data Source

Postal code data is sourced from Bring.

Requirements

  • PHP 8.1 or higher

License

MIT

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固