composer require bvp/prefecture
<?php
require __DIR__ . '/vendor/autoload.php';
use Boatrace\Venture\Project\Prefecture;
$collection = Prefecture::byId(13);
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"
$collection = Prefecture::byName('東京都');
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"
$collection = Prefecture::byShortName('東京');
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"
$collection = Prefecture::byHiraganaName('とうきょうと');
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"
$collection = Prefecture::byKatakanaName('トウキョウト');
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"
$collection = Prefecture::byEnglishName('tokyo');
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"
Prefecture in the Boatrace Venture Project is open source software licensed under the MIT license.