PHPackages                             nedka/vietnamese - 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. nedka/vietnamese

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

nedka/vietnamese
================

The Vietnamese toolkit for PHP.

1.0.13(9mo ago)06MITPHPPHP &gt;=8.0

Since Jul 3Pushed 9mo agoCompare

[ Source](https://github.com/NEDKA/Vietnamese)[ Packagist](https://packagist.org/packages/nedka/vietnamese)[ RSS](/packages/nedka-vietnamese/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

🇻🇳 Vietnamese
=============

[](#-vietnamese)

The Vietnamese toolkit for PHP.

Requirements
------------

[](#requirements)

- PHP 8.0+.

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

[](#installation)

Require this package in your `composer.json`:

```
composer require nedka/vietnamese
composer install

```

---

Import the package:

```
use NEDKA\Vietnamese\Vietnamese;
```

Usage
-----

[](#usage)

Format names:

```
Vietnamese::format('ViỆt NaM')
```

Result: `Việt Nam`

---

Remove all accents:

```
Vietnamese::clean('Việt Nam')
```

Result: `Viet Nam`

---

Convert into NCR Decimal:

```
Vietnamese::clean('Việt Nam', 'ncr_decimal')
```

Result: `Vi&#7879;t Nam`

---

Run all available methods for correcting spelling errors:

```
Vietnamese::correct('THI tUổi KỈ Tị')
```

Result: `Thi tuổi Kỷ Tỵ`

---

Correct wrong accent placements:

```
Vietnamese::correctAccent('Vịêt Nam')
```

Result: `Việt Nam`

---

Correct wrong cases between "i" and "y":

```
Vietnamese::correctIY('Thi tuổi Kỉ Tị')
```

Result: `Thi tuổi Kỷ Tỵ`

---

Sorting words:

Sorting by values in a string with delimiter:

```
Vietnamese::sort('Ă, A, Â, À, Á')
```

Result: `A, Á, À, Ă, Â`

Sorting by values in a simple array:

```
Vietnamese::sort(['Ă', 'A', 'Â', 'À', 'Á'])
```

Result: `['A', 'Á', 'À', 'Ă', 'Â']`

Sorting a two-dimensional array by multiple keys in order:

```
$array = [
	['name' => 'Cần Thơ', 'valid_date' => '2004-01-01'],
	['name' => 'Cà Mau', 'valid_date' => '1997-01-01'],
	['name' => 'Cần Thơ', 'valid_date' => '1992-01-01']
];
$array = Vietnamese::sort($array, ['name', 'valid_date']);
```

Result:

```
array:3 [
	0 => array:2 [
		"name" => "Cà Mau"
		"valid_date" => "1997-01-01"
	]
	1 => array:2 [
		"name" => "Cần Thơ"
		"valid_date" => "1992-01-01"
	]
	2 => array:2 [
		"name" => "Cần Thơ"
		"valid_date" => "2004-01-01"
	]
]
```

---

Sorting people names:

Sorting by values in a string with delimiter:

```
Vietnamese::sortPeopleName('Nguyễn Văn Đảnh, Nguyễn VĂN Đàn, nguYỄn Văn Đàng, NGUYỄN Văn Đang, nguyễn anh đang')
```

Result: `Nguyễn Anh Đang, Nguyễn Văn Đang, Nguyễn Văn Đàn, Nguyễn Văn Đàng, Nguyễn Văn Đảnh`

Sorting by values in a simple array:

```
Vietnamese::sortPeopleName(['Nguyễn Văn Đảnh', 'Nguyễn VĂN Đàn', 'nguYỄn Văn Đàng', 'NGUYỄN Văn Đang', 'nguyễn anh đang'])
```

Result: `['Nguyễn Anh Đang', 'Nguyễn Văn Đang', 'Nguyễn Văn Đàn', 'Nguyễn Văn Đàng', 'Nguyễn Văn Đảnh']`

Sorting a two-dimensional array by multiple keys in order:

```
$array = [
	['name' => 'Nguyễn Văn Đảnh', 'birth_date' => '1999-01-30'],
	['name' => 'Nguyễn VĂN Đàn', 'birth_date' => '1996-01-30'],
	['name' => 'Nguyễn Văn Đảnh', 'birth_date' => '1997-01-30'],
	['name' => 'NGUYỄN Văn Đang', 'birth_date' => '1995-01-30'],
	['name' => 'Nguyễn VĂN Đàn', 'birth_date' => '1994-01-30']
];
$array = Vietnamese::sortPeopleName($array, ['name', 'birth_date']);
```

Result:

```
array:5 [
	0 => array:2 [
		"name" => "Nguyễn Văn Đang"
		"birth_date" => "1995-01-30"
	]
	1 => array:2 [
		"name" => "Nguyễn Văn Đàn"
		"birth_date" => "1994-01-30"
	]
	2 => array:2 [
		"name" => "Nguyễn Văn Đàn"
		"birth_date" => "1996-01-30"
	]
	3 => array:2 [
		"name" => "Nguyễn Văn Đảnh"
		"birth_date" => "1997-01-30"
	]
	4 => array:2 [
		"name" => "Nguyễn Văn Đảnh"
		"birth_date" => "1999-01-30"
	]
]
```

---

Check a character in the Vietnamese alphabet:

```
Vietnamese::checkChar('w')
```

Result: `false`

---

Scan and detect incorrect words in Vietnamese:

```
Vietnamese::scan('Xứ Wales thắng Nga, đứng nhất bảng B')
```

Result: `['Wales']`

Otherwise, get correct words:

```
Vietnamese::scan('Xứ Wales thắng Nga, đứng nhất bảng B', false)
```

Result: `['Xứ', 'thắng', 'Nga', 'đứng', 'nhất', 'bảng', 'B']`

---

Print the way to speak a Vietnamese text string:

```
Vietnamese::speak('Việt Nam')
```

Result: `i ê tờ iêt, vờ iêt viêt nặng /việt/; a mờ am, nờ am /nam/; /việt nam/`

---

Convert number to text:

```
Vietnamese::speak(1452369)
```

Result: `một triệu bốn trăm năm mươi hai nghìn ba trăm sáu mươi chín`

License
-------

[](#license)

Copyright (c) NEDKA. All rights reserved.

Licensed under the MIT License.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance56

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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 ~13 days

Total

3

Last Release

294d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/780df91aa905563cc3de0efd11d4cb162b49d15575896ba223a210f0e3537188?d=identicon)[nedka](/maintainers/nedka)

---

Top Contributors

[![ned-ka](https://avatars.githubusercontent.com/u/703941?v=4)](https://github.com/ned-ka "ned-ka (70 commits)")

---

Tags

phpvietnamese

### Embed Badge

![Health badge](/badges/nedka-vietnamese/health.svg)

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

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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