PHPackages                             one23/iso639 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. one23/iso639

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

one23/iso639
============

PHP library to convert ISO-639

1.0.2(3y ago)0461MITPHPPHP ~8

Since Nov 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/FlexIDK/iso639)[ Packagist](https://packagist.org/packages/one23/iso639)[ Docs](https://github.com/FlexIDK/iso639)[ RSS](/packages/one23-iso639/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (1)

PHP ISO-639
===========

[](#php-iso-639)

PHP library to convert ISO-639 code

---

Installation
------------

[](#installation)

```
composer require one23/iso639
```

Data source
-----------

[](#data-source)

- en.wikipedia.org: [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) : iso-639-old.csv (deprecate)
- en.wikipedia.org: [List of ISO 639-1 codes](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) : iso-639-1.csv
- en.wikipedia.org: [ISO 639-2](https://en.wikipedia.org/wiki/ISO_639-2) : iso-639-2-group.csv
- en.wikipedia.org: [List of ISO 639-3 language codes](https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Languages/List_of_ISO_639-3_language_codes_(2019)) : iso-639-3-name.csv
- en.wikipedia.org: [ISO 639 macrolanguage](https://en.wikipedia.org/wiki/ISO_639_macrolanguage) : iso-639-3.csv
- en.wikipedia.org: [List of ISO 639-5 codes](https://en.wikipedia.org/wiki/List_of_ISO_639-5_codes) : iso-639-5.csv
- en.wikipedia.org: [List of ISO 639-6 codes](https://en.wikipedia.org/wiki/List_of_ISO_639-6_codes) : iso-639-6.csv
- iso639-3.sil.org: [ISO 639-3 Downloads](https://iso639-3.sil.org/code_tables/download_tables) : iso-639-3-macrolanguages\_20220311.csv, iso-639-3\_20220311.csv, iso-639-3\_name\_index\_20220311.csv, iso-639-3\_retirements\_20220311.csv

Update date: 2022-11-23

How to
------

[](#how-to)

```
use \One23\Iso639\Code1;
use \One23\Iso639\Code2b;
use \One23\Iso639\Code2t;
use \One23\Iso639\Code3;
// or
//use \One23\Iso639\Code3Min as Code3;

(string)Code1::from('en')->code3(); // => 'eng'
(string)Code1::from('uk')->getNameNative(); // => 'українська мова'
(string)Code1::from('jv')->getName(); // => 'Javanese'

(string)Code2t::from('eng')->getName(); // => 'English'
(string)Code2t::from('ind')->getNameNative(); // => 'Bahasa Indonesia'
(string)Code2t::from('jav')->code1(); // => 'jv'
```

Use
---

[](#use)

### Code1 &amp;&amp; Code2b &amp;&amp; Code2t

[](#code1--code2b--code2t)

**Static methods**

- from(string $code): Code3
- all(): string\[\]

**Methods**

- getCode(): string
- getName(): ?string
- getNameNative(): ?string
- getNotes(): ?string
- getFamily(): ?string
- isMacrolanguage(): bool
- isAncient(): bool
- macrolanguages(): Code3Macro\[\]
- code1(): ?Code1
- code2t(): ?Code2t
- code2b(): ?Code2b
- code3(): ?Code3
- toString(): string - alias getCode()
- toArray(): array{iso\_639\_1\_code: string, iso\_639\_1\_name: ?string, iso\_639\_1\_native: ?string, iso\_639\_1\_notes: ?string, iso\_639\_2\_t\_code: ?string, iso\_639\_2\_t\_name: ?string, iso\_639\_2\_b\_code: ?string, iso\_639\_2\_b\_name: ?string, iso\_639\_3\_code: ?string, iso\_639\_5\_code: ?Code3, iso\_639\_5\_name: ?string, iso\_639\_6\_code: ?string}

```
use \One23\Iso639\Code1 as Code;
// or
//use \One23\Iso639\Code2b as Code;
// or
//use \One23\Iso639\Code2t as Code;

$code = Code::from('en');

(string)$code; // => 'en'
// or
$code->getCode(); // => 'en'
// or
$code->toString(); // => 'en'

$code->getName(); // => 'English'

$code->toArray();
// => "{"iso_639_1_code":"en","iso_639_1_name":"English","iso_639_1_native":"English","iso_639_1_notes":null,"iso_639_1_family":"Indo-European","is_ancient":false,"is_macrolanguage":false,"macrolanguages":[],"iso_639_2_t_code":"eng","iso_639_2_t_name":"English","iso_639_2_b_code":"eng","iso_639_2_b_name":"English","iso_639_3_code":"eng","iso_639_6_code":"engs"}

$code1 = Code2b::from('ara')->code1();
$macrolanguages = $code1->macrolanguages();

array_keys($macrolanguages); // => ["aao","abh","abv","acm","acq",...]
reset($macrolanguages); // Code3Macro

Code1::all(); // => ["ab","aa","af","ak",...]
Code2b::all(); // => ["abk","aar","afr","aka","alb","amh",...]
Code2t::all(); // => ["abk","aar","afr","aka","sqi","amh","ara","arg",...]
```

### Code3 &amp;&amp; Code3All &amp;&amp; Code3Min (only with 639-1)

[](#code3--code3all--code3min-only-with-639-1)

**Static methods**

- from(string $code): Code3
- all(): string\[\]

**Methods**

- getCode(): string
- getName(): ?string
- getNameInverted(): ?string
- getScope(): ?string
- getType(): ?string
- getNotes(): ?string
- code1(): ?Code1
- code2t(): ?Code2t
- code2b(): ?Code2b
- code3(): ?Code3
- merge(): ?Code3
- toString(): string - alias getCode()
- toArray(): array{iso\_639\_3\_code: string, iso\_639\_3\_name: ?string, iso\_639\_3\_name\_inverted: ?string, iso\_639\_3\_scope: ?string, iso\_639\_3\_type: ?string, iso\_639\_3\_notes: ?string, iso\_639\_1\_code: ?string, iso\_639\_2\_b\_code: ?string, iso\_639\_2\_t\_code: ?string, iso\_639\_3\_merge: ?Code3, iso\_639\_3\_merge\_reason: ?string, iso\_639\_3\_merge\_date: ?string}

```
use \One23\Iso639\Code3;
// or
//use \One23\Iso639\Code3All as Code3;

$code3 = Code3::from('ful');

(string)$code3; // => 'ful'
// or
$code3->getCode(); // => 'ful'
// or
$code3->toString(); // => 'ful'

$code3->getName(); // => 'Fulah'

$code3->toArray();
// => {"iso_639_3_code":"ful","iso_639_3_name":"Fulah","iso_639_3_name_inverted":"Fulah","iso_639_3_scope":"M","iso_639_3_type":"L","iso_639_3_notes":null,"iso_639_1_code":"ff","iso_639_2_b_code":"ful","iso_639_2_t_code":"ful","iso_639_3_merge":null,"iso_639_3_merge_reason":null,"iso_639_3_merge_date":null}

$code3 = Code3All::from('xrq');

/** @var Code3All|null $merge **/
$merge = $code3->merge()
if ($merge) {
    $merge->toArray();
    // => {"iso_639_3_code":"dmw","iso_639_3_name":"Mudburra","iso_639_3_name_inverted":"Mudburra","iso_639_3_scope":"I","iso_639_3_type":"L","iso_639_3_notes":null,"iso_639_1_code":null,"iso_639_2_b_code":null,"iso_639_2_t_code":null,"iso_639_3_merge":null,"iso_639_3_merge_reason":null,"iso_639_3_merge_date":null}
}

Code3::all(); // => ["aka","ara","aym","aze","bal",...]
```

### Code3Macro

[](#code3macro)

**Static methods**

- from(string $code): Code3
- all(): string\[\]

**Methods**

- getCode(): string
- getName(): ?string
- getStatus(): ?string
- code1(): ?Code1
- code2t(): ?Code2t
- code2b(): ?Code2b
- code3(): ?Code3
- alias(): ?Code3Macro
- toString(): string - alias getCode()
- toArray(): array{macrolanguage\_code: string, macrolanguage\_name: ?string, macrolanguage\_status: string, macrolanguage\_alias: ?string, iso\_639\_3\_code: ?string}

```
use \One23\Iso639\Code3Macro;

$code3Macro = Code3Macro::from('pmu');

(string)$code3Macro; // => 'pmu'
// or
$code3Macro->getCode(); // => 'pmu'
// or
$code3Macro->toString(); // => 'pmu'

$code3Macro->getName(); // => 'Mirpur Panjabi'

$code3Macro->toArray();
// => {"macrolanguage_code":"pmu","macrolanguage_name":"Mirpur Panjabi","macrolanguage_status":"R","macrolanguage_alias":"phr","iso_639_3_code":"lah"}

/** @var Code3Macro|null $parent **/
$alias = $code3Macro->alias()
if ($alias) {
    $alias->toArray();
    // => {"macrolanguage_code":"phr","macrolanguage_name":"Pahari-Potwari","macrolanguage_status":"A","macrolanguage_alias":null,"iso_639_3_code":"lah"}
}

Code3Macro::all(); // => ["fat","twi","aao","abh","abv","acm",...]
```

### Code5

[](#code5)

**Static methods**

- from(string $code): Code5
- all(): string\[\]

**Methods**

- getCode(): string
- getName(): ?string
- getNotes(): ?string
- parent(): ?Code5
- code1(): ?Code1
- code2t(): ?Code2t
- code3(): ?Code3
- toString(): string - alias getCode()
- toArray(): array{iso\_639\_5\_code: string, iso\_639\_5\_name: ?string, iso\_639\_5\_notes: ?string, parent: ?string, iso\_639\_2\_t\_code: ?string, iso\_639\_2\_b\_code: ?string}

```
use \One23\Iso639\Code5;

$code5 = Code5::from('alg');

(string)$code5; // => 'alg'
// or
$code5->getCode(); // => 'alg'
// or
$code5->toString(); // => 'alg'

$code5->getName(); // => 'Algonquian languages'

$code5->toArray();
// => {"iso_639_5_code":"alg","iso_639_5_name":"Algonquian languages","iso_639_5_notes":null,"iso_639_5_parent":"aql","iso_639_2_t_code":"alg","iso_639_2_b_code":null}

/** @var Code5|null $parent **/
$parent = $code5->parent()
if ($parent) {
    $parent->toArray();
    // => {"iso_639_5_code":"aql","iso_639_5_name":"Algic languages","iso_639_5_notes":null,"iso_639_5_parent":"nai","iso_639_2_t_code":null,"iso_639_2_b_code":null}
}

Code5::all(); // => ["aav","afa","alg","alv","apa",...]

$code5 = Code5::from('aav');
$code5->getNotes(); // => 'South-Asiatic languages, not related to Australian languages'
```

### Code6

[](#code6)

**Static methods**

- from(string $code): Code5
- all(): string\[\]

**Methods**

- getCode(): string
- getName(): ?string
- toString(): string - alias getCode()
- toArray(): array{iso\_639\_6\_code: string, iso\_639\_6\_name: ?string}

```
use \One23\Iso639\Code6;

$code6 = Code6::from('tjin');

(string)$code6; // => 'tjin'
// or
$code6->getCode(); // => 'tjin'
// or
$code6->toString(); // => 'tjin'

$code6->getName(); // => 'Tianjin'

$code6->toArray();
// => {"iso_639_6_code":"tjin","iso_639_6_name":"Tianjin"}

Code6::all(); // => ["ango","bicr","bjgh","bjjg",...]
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

[MIT](https://github.com/FlexIDK/iso639/LICENSE)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1267d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8311e2852f397956d5401ea17683fc8ee583dc68635cdff2fc2f8a5fefb23a98?d=identicon)[FlexIDK](/maintainers/FlexIDK)

---

Top Contributors

[![FlexIDK](https://avatars.githubusercontent.com/u/8653521?v=4)](https://github.com/FlexIDK "FlexIDK (4 commits)")

---

Tags

languageisolangiso-639639

### Embed Badge

![Health badge](/badges/one23-iso639/health.svg)

```
[![Health](https://phpackages.com/badges/one23-iso639/health.svg)](https://phpackages.com/packages/one23-iso639)
```

###  Alternatives

[matriphe/iso-639

PHP library to convert ISO-639-1 code to language name.

503.3M6](/packages/matriphe-iso-639)[phpoption/phpoption

Option Type for PHP

2.7k541.2M159](/packages/phpoption-phpoption)[league/iso3166

ISO 3166-1 PHP Library

69536.3M116](/packages/league-iso3166)[coderello/laravel-nova-lang

Language support for Laravel Nova.

4251.2M2](/packages/coderello-laravel-nova-lang)[patrickschur/language-detection

A language detection library for PHP. Detects the language from a given text string.

8513.2M18](/packages/patrickschur-language-detection)[wapmorgan/morphos

A morphological solution for Russian and English language written completely in PHP. Provides classes to inflect personal names, geographical names, decline and pluralize nouns, generate cardinal and ordinal numerals, spell out money amounts and time.

8351.3M7](/packages/wapmorgan-morphos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
