Menu

## Province
in package

Province.php : 18

This class provides a list of provinces in Thailand and Laos.

##### Tags

see
  https://www.kotchasan.com/

### Table of Contents

all() : array<string|int, mixed>
  Get a list of all provinces.
countries() : array<string|int, mixed>
  Get a list of countries with installed provinces.
get() : string
  Get the name of a province based on its ISO code and language.
isoFromProvince() : string
  Get the ISO code of a province based on its name and language.
init() : array<string|int, mixed>
  Load provinces based on the selected country.
LA() : array<string|int, mixed>
  List of provinces in Laos, sorted by Lao name.
TH() : array<string|int, mixed>
  List of provinces in Thailand, sorted by Thai name.

### Methods

#### all()

Province.php : 45

Get a list of all provinces.

`public static all([string $country = 'TH' ]) : array<string|int, mixed>`

It returns the names of provinces in the specified language (defaults to English).

##### Parameters

$country : string = 'TH'

  (default: 'TH')

##### Return values

array<string|int, mixed> —

#### countries()

Province.php : 68

Get a list of countries with installed provinces.

`public static countries() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### get()

Province.php : 86

Get the name of a province based on its ISO code and language.

`public static get(int $iso[, string $lang = '' ][, string $country = 'TH' ]) : string`

If the language is not specified, it uses the current language. Returns an empty string if the province is not found.

##### Parameters

$iso : int
$lang : string = ''
$country : string = 'TH'

  (default: 'TH')

##### Tags

assert

  (10) [==] 'กรุงเทพมหานคร'

##### Return values

string —

#### isoFromProvince()

Province.php : 105

Get the ISO code of a province based on its name and language.

`public static isoFromProvince(string $province[, string $lang = '' ][, string $country = 'TH' ]) : string`

##### Parameters

$province : string

  The name of the province

$lang : string = ''

  The language code for the desired language (e.g., 'th' for Thai, 'en' for English)

$country : string = 'TH'

  (default: 'TH')

##### Return values

string —

The ISO code of the province

#### init()

Province.php : 28

Load provinces based on the selected country.

`private static init(string $country) : array<string|int, mixed>`

If not specified, it uses Thailand as the default country.

##### Parameters

$country : string

##### Return values

array<string|int, mixed> —

#### LA()

Province.php : 215

List of provinces in Laos, sorted by Lao name.

`private static LA() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

An array containing province data for Laos

#### TH()

Province.php : 127

List of provinces in Thailand, sorted by Thai name.

`private static TH() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

An array containing province data for Thailand

## Search results