PHPackages                             voku/portable-ascii - 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. voku/portable-ascii

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

voku/portable-ascii
===================

Portable ASCII library - performance optimized (ascii) string functions for php.

2.0.3(1y ago)574401.5M—2.6%48[17 issues](https://github.com/voku/portable-ascii/issues)[7 PRs](https://github.com/voku/portable-ascii/pulls)20MITPHPPHP &gt;=7.0.0CI passing

Since Sep 5Pushed today4 watchersCompare

[ Source](https://github.com/voku/portable-ascii)[ Packagist](https://packagist.org/packages/voku/portable-ascii)[ Docs](https://github.com/voku/portable-ascii)[ Fund](https://www.paypal.me/moelleken)[ GitHub Sponsors](https://github.com/voku)[ RSS](/packages/voku-portable-ascii/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (50)Used By (20)

[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)

[![Build Status](https://github.com/voku/portable-ascii/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/voku/portable-ascii/actions)[![Build status](https://camo.githubusercontent.com/554c5fb1dbb28504ef87a2e18a8f7ae14fc77eb84f854994d6a954149fb6ab0f/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f676e656a6a6e6b3771706c72376635742f6272616e63682f6d61737465723f7376673d74727565)](https://ci.appveyor.com/project/voku/portable-ascii/branch/master)[![codecov.io](https://camo.githubusercontent.com/b0efd63ee9cd617700e134174a5550036e55d6e7a8bdda669f939934110dd486/68747470733a2f2f636f6465636f762e696f2f6769746875622f766f6b752f706f727461626c652d61736369692f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/voku/portable-ascii?branch=master)[![Codacy Badge](https://camo.githubusercontent.com/bc582aac37c49de26c7f44d0eb9d5f007a5c146e201ae3a3a627be383c5dbcf0/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3939376339626231306431633437393139363762646632653432303133653865)](https://www.codacy.com/app/voku/portable-ascii)[![Latest Stable Version](https://camo.githubusercontent.com/4d3fd28777450bfb90ddbecf3c49804d961d3f788f79df00b588bce6a8d29fac/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f706f727461626c652d61736369692f762f737461626c65)](https://packagist.org/packages/voku/portable-ascii)[![Total Downloads](https://camo.githubusercontent.com/c5799e1f3271ea8d502dbe027f656f41a53769dcc7326125c802f161c694dbcf/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f706f727461626c652d61736369692f646f776e6c6f616473)](https://packagist.org/packages/voku/portable-ascii)[![License](https://camo.githubusercontent.com/1ef5effc5746914e5b45e9dd7fb978f8e2859218a523f2e90a2870c2fe0084a4/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f706f727461626c652d61736369692f6c6963656e7365)](https://packagist.org/packages/voku/portable-ascii)[![Donate to this project using Paypal](https://camo.githubusercontent.com/0d6e4d8b50b5983a58205941b1a581b1305903393b7a39da574e3f60af3c7f5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617970616c2d646f6e6174652d79656c6c6f772e737667)](https://www.paypal.me/moelleken)[![Donate to this project using Patreon](https://camo.githubusercontent.com/f9e075baad95563481d35174d43ef50757281abb6bc795d0f473fad452afa030/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617472656f6e2d646f6e6174652d79656c6c6f772e737667)](https://www.patreon.com/voku)

🔡 Portable ASCII
================

[](#-portable-ascii)

Description
-----------

[](#description)

It is written in PHP (PHP 7+) and can work without "mbstring", "iconv" or any other extra encoding php-extension on your server.

The benefit of Portable ASCII is that it is easy to use, easy to bundle.

The project based on ...

- Sean M. Burke's work ()
- Tomaz Solc's work ()
- Portable UTF-8 work ()
- Daniel St. Jules's work ()
- Johnny Broadway's work ()
- and many cherry-picks from "github"-gists and "Stack Overflow"-snippets ...

Index
-----

[](#index)

- [Alternative](#alternative)
- [Install](#install-portable-ascii-via-composer-require)
- [Why Portable ASCII?](#why-portable-ascii)
- [Requirements and Recommendations](#requirements-and-recommendations)
- [Usage](#usage)
- [Class methods](#class-methods)
- [Unit Test](#unit-test)
- [License and Copyright](#license-and-copyright)

Alternative
-----------

[](#alternative)

If you like a more Object Oriented Way to edit strings, then you can take a look at [voku/Stringy](https://github.com/voku/Stringy), it's a fork of "danielstjules/Stringy" but it used the "Portable ASCII"-Class and some extra methods.

```
// Portable ASCII
use voku\helper\ASCII;
ASCII::to_transliterate('déjà σσς iıii'); // 'deja sss iiii'

// voku/Stringy
use Stringy\Stringy as S;
$stringy = S::create('déjà σσς iıii');
$stringy->toTransliterate();              // 'deja sss iiii'
```

Install "Portable ASCII" via "composer require"
-----------------------------------------------

[](#install-portable-ascii-via-composer-require)

```
composer require voku/portable-ascii
```

Why Portable ASCII?
----------------------------------

[](#why-portable-ascii)

I need ASCII char handling in different classes and before I added this functions into "Portable UTF-8", but this repo is more modular and portable, because it has no dependencies.

Requirements and Recommendations
--------------------------------

[](#requirements-and-recommendations)

- No extensions are required to run this library. Portable ASCII only needs PCRE library that is available by default since PHP 4.2.0 and cannot be disabled since PHP 5.3.0. "\\u" modifier support in PCRE for ASCII handling is not a must.
- PHP 7.1 is the minimum requirement
- up to PHP 8.5 is also supported

Usage
-----

[](#usage)

Example: ASCII::to\_ascii()

```
  echo ASCII::to_ascii('�Düsseldorf�', 'de');

  // will output
  // Duesseldorf

  echo ASCII::to_ascii('�Düsseldorf�', 'en');

  // will output
  // Dusseldorf
```

Portable ASCII | API
====================

[](#portable-ascii--api)

The API from the "ASCII"-Class is written as small static methods.

Class methods
-------------

[](#class-methods)

[charsArray](#charsarraybool-replace_extra_symbols-array)[charsArrayWithMultiLanguageValues](#charsarraywithmultilanguagevaluesbool-replace_extra_symbols-array)[charsArrayWithOneLanguage](#charsarraywithonelanguagestring-language-bool-replace_extra_symbols-bool-asorigreplacearray-array)[charsArrayWithSingleLanguageValues](#charsarraywithsinglelanguagevaluesbool-replace_extra_symbols-bool-asorigreplacearray-array)[clean](#cleanstring-str-bool-normalize_whitespace-bool-keep_non_breaking_space-bool-normalize_msword-bool-remove_invisible_characters-string)[getAllLanguages](#getalllanguages-string)[is\_ascii](#is_asciistring-str-bool)[normalize\_msword](#normalize_mswordstring-str-string)[normalize\_whitespace](#normalize_whitespacestring-str-bool-keepnonbreakingspace-bool-keepbidiunicodecontrols-bool-normalize_control_characters-string)[remove\_invisible\_characters](#remove_invisible_charactersstring-str-bool-url_encoded-string-replacement-bool-keep_basic_control_characters-string)[to\_ascii](#to_asciistring-str-string-language-bool-remove_unsupported_chars-bool-replace_extra_symbols-bool-use_transliterate-boolnull-replace_single_chars_only-string)[to\_ascii\_remap](#to_ascii_remapstring-str1-string-str2-string)[to\_filename](#to_filenamestring-str-bool-use_transliterate-string-fallback_char-string)[to\_slugify](#to_slugifystring-str-string-separator-string-language-string-replacements-bool-replace_extra_symbols-bool-use_str_to_lower-bool-use_transliterate-string)[to\_transliterate](#to_transliteratestring-str-stringnull-unknown-bool-strict-string)#### charsArray(bool $replace\_extra\_symbols): array

[](#charsarraybool-replace_extra_symbols-array)

[↑](#voku-php-readme-class-methods)Returns an replacement array for ASCII methods.

EXAMPLE: `$array = ASCII::charsArray();var_dump($array['ru']['б']); // 'b'`

**Parameters:**

- `bool $replace_extra_symbols [optional] Add some more replacements e.g. "£" with " pound ".`

**Return:**

- `array`

---

#### charsArrayWithMultiLanguageValues(bool $replace\_extra\_symbols): array

[](#charsarraywithmultilanguagevaluesbool-replace_extra_symbols-array)

[↑](#voku-php-readme-class-methods)Returns an replacement array for ASCII methods with a mix of multiple languages.

EXAMPLE: `$array = ASCII::charsArrayWithMultiLanguageValues();var_dump($array['b']); // ['β', 'б', 'ဗ', 'ბ', 'ب']`

**Parameters:**

- `bool $replace_extra_symbols [optional] Add some more replacements e.g. "£" with " pound ".`

**Return:**

- `array An array of replacements.`

---

#### charsArrayWithOneLanguage(string $language, bool $replace\_extra\_symbols, bool $asOrigReplaceArray): array

[](#charsarraywithonelanguagestring-language-bool-replace_extra_symbols-bool-asorigreplacearray-array)

[↑](#voku-php-readme-class-methods)Returns an replacement array for ASCII methods with one language.

For example, German will map 'ä' to 'ae', while other languages will simply return e.g. 'a'.

EXAMPLE: `$array = ASCII::charsArrayWithOneLanguage('ru');$tmpKey = \array_search('yo', $array['replace']);echo $array['orig'][$tmpKey]; // 'ё'`

**Parameters:**

- `ASCII::* $language [optional] Language of the source string e.g.: en, de_at, or de-ch. (default is 'en') | ASCII::*_LANGUAGE_CODE`
- `bool $replace_extra_symbols [optional] Add some more replacements e.g. "£" with " pound ".`
- `bool $asOrigReplaceArray [optional] TRUE === return {orig: string[], replace: string[]} array`

**Return:**

- `array An array of replacements.`

---

#### charsArrayWithSingleLanguageValues(bool $replace\_extra\_symbols, bool $asOrigReplaceArray): array

[](#charsarraywithsinglelanguagevaluesbool-replace_extra_symbols-bool-asorigreplacearray-array)

[↑](#voku-php-readme-class-methods)Returns an replacement array for ASCII methods with multiple languages.

EXAMPLE: `$array = ASCII::charsArrayWithSingleLanguageValues();$tmpKey = \array_search('hnaik', $array['replace']);echo $array['orig'][$tmpKey]; // '၌'`

**Parameters:**

- `bool $replace_extra_symbols [optional] Add some more replacements e.g. "£" with " pound ".`
- `bool $asOrigReplaceArray [optional] TRUE === return {orig: string[], replace: string[]} array`

**Return:**

- `array An array of replacements.`

---

#### clean(string $str, bool $normalize\_whitespace, bool $keep\_non\_breaking\_space, bool $normalize\_msword, bool $remove\_invisible\_characters): string

[](#cleanstring-str-bool-normalize_whitespace-bool-keep_non_breaking_space-bool-normalize_msword-bool-remove_invisible_characters-string)

[↑](#voku-php-readme-class-methods)Accepts a string and removes malformed UTF-8 from it + extras if needed.

**Parameters:**

- `string $str The string to be sanitized.`
- `bool $normalize_whitespace [optional] Set to true, if you need to normalize the whitespace.`
- `bool $keep_non_breaking_space [optional] Set to true, to keep non-breaking-spaces, in combination with $normalize_whitespace`
- `bool $normalize_msword [optional] Set to true, if you need to normalize MS Word chars e.g.: "…" => "..."`
- `bool $remove_invisible_characters [optional] Set to false, if you not want to remove invisible characters e.g.: "\0"`

**Return:**

- `string A clean UTF-8 string with malformed byte sequences removed.`

---

#### getAllLanguages(): string\[\]

[](#getalllanguages-string)

[↑](#voku-php-readme-class-methods)Get all languages from the constants "ASCII::.\*LANGUAGE\_CODE".

**Parameters:****nothing**

**Return:**

- `string[]`

---

#### is\_ascii(string $str): bool

[](#is_asciistring-str-bool)

[↑](#voku-php-readme-class-methods)Checks if a string is 7 bit ASCII.

EXAMPLE: `ASCII::is_ascii('白'); // false`

**Parameters:**

- `string $str The string to check.`

**Return:**

- `bool **true** if it is ASCII
    **false** otherwise

` ---

#### normalize\_msword(string $str): string

[](#normalize_mswordstring-str-string)

[↑](#voku-php-readme-class-methods)Returns a string with smart quotes, ellipsis characters, and dashes from Windows-1252 (commonly used in Word documents) replaced by their ASCII equivalents.

EXAMPLE: `ASCII::normalize_msword('„Abcdef…”'); // '"Abcdef..."'`

**Parameters:**

- `string $str The string to be normalized.`

**Return:**

- `string A string with normalized characters for commonly used chars in Word documents.`

---

#### normalize\_whitespace(string $str, bool $keepNonBreakingSpace, bool $keepBidiUnicodeControls, bool $normalize\_control\_characters): string

[](#normalize_whitespacestring-str-bool-keepnonbreakingspace-bool-keepbidiunicodecontrols-bool-normalize_control_characters-string)

[↑](#voku-php-readme-class-methods)Normalize the whitespace.

EXAMPLE: `ASCII::normalize_whitespace("abc-\xc2\xa0-öäü-\xe2\x80\xaf-\xE2\x80\xAC", true); // "abc-\xc2\xa0-öäü- -"`

**Parameters:**

- `string $str The string to be normalized.`
- `bool $keepNonBreakingSpace [optional] Set to true, to keep non-breaking-spaces.`
- `bool $keepBidiUnicodeControls [optional] Set to true, to keep non-printable (for the web) bidirectional text chars.`
- `bool $normalize_control_characters [optional] Set to true, to convert e.g. LINE-, PARAGRAPH-SEPARATOR with "\n" and LINE TABULATION with "\t".`

**Return:**

- `string A string with normalized whitespace.`

---

#### remove\_invisible\_characters(string $str, bool $url\_encoded, string $replacement, bool $keep\_basic\_control\_characters): string

[](#remove_invisible_charactersstring-str-bool-url_encoded-string-replacement-bool-keep_basic_control_characters-string)

[↑](#voku-php-readme-class-methods)Remove invisible characters from a string.

e.g.: This prevents sandwiching null characters between ascii characters, like Java\\0script.

copy&amp;past from

**Parameters:**

- `string $str`
- `bool $url_encoded`
- `string $replacement`
- `bool $keep_basic_control_characters`

**Return:**

- `string`

---

#### to\_ascii(string $str, string $language, bool $remove\_unsupported\_chars, bool $replace\_extra\_symbols, bool $use\_transliterate, bool|null $replace\_single\_chars\_only): string

[](#to_asciistring-str-string-language-bool-remove_unsupported_chars-bool-replace_extra_symbols-bool-use_transliterate-boolnull-replace_single_chars_only-string)

[↑](#voku-php-readme-class-methods)Returns an ASCII version of the string. A set of non-ASCII characters are replaced with their closest ASCII counterparts, and the rest are removed by default. The language or locale of the source string can be supplied for language-specific transliteration in any of the following formats: en, en\_GB, or en-GB. For example, passing "de" results in "äöü" mapping to "aeoeue" rather than "aou" as in other languages.

EXAMPLE: `ASCII::to_ascii('�Düsseldorf�', 'en'); // Dusseldorf`

**Parameters:**

- `string $str The input string.`
- `ASCII::* $language [optional] Language of the source string. (default is 'en') | ASCII::*_LANGUAGE_CODE`
- `bool $remove_unsupported_chars [optional] Whether or not to remove the unsupported characters.`
- `bool $replace_extra_symbols [optional]  Add some more replacements e.g. "£" with " pound ".`
- `bool $use_transliterate [optional]  Use ASCII::to_transliterate() for unknown chars.`
- `bool|null $replace_single_chars_only [optional]  Single char replacement is better for the performance, but some languages need to replace more then one char at the same time. | NULL === auto-setting, depended on the language`

**Return:**

- `string A string that contains only ASCII characters.`

---

#### to\_ascii\_remap(string $str1, string $str2): string\[\]

[](#to_ascii_remapstring-str1-string-str2-string)

[↑](#voku-php-readme-class-methods)WARNING: This method will return broken characters and is only for special cases.

Convert two UTF-8 encoded string to a single-byte strings suitable for functions that need the same string length after the conversion.

The function simply uses (and updates) a tailored dynamic encoding (in/out map parameter) where non-ascii characters are remapped to the range \[128-255\] in order of appearance.

**Parameters:**

- `string $str1`
- `string $str2`

**Return:**

- `string[]`

---

#### to\_filename(string $str, bool $use\_transliterate, string $fallback\_char): string

[](#to_filenamestring-str-bool-use_transliterate-string-fallback_char-string)

[↑](#voku-php-readme-class-methods)Convert given string to safe filename (and keep string case).

EXAMPLE: `ASCII::to_filename('שדגשדג.png', true)); // 'shdgshdg.png'`

**Parameters:**

- `string $str`
- `bool $use_transliterate ASCII::to_transliterate() is used by default - unsafe characters are simply replaced with hyphen otherwise.`
- `string $fallback_char`

**Return:**

- `string A string that contains only safe characters for a filename.`

---

#### to\_slugify(string $str, string $separator, string $language, string\[\] $replacements, bool $replace\_extra\_symbols, bool $use\_str\_to\_lower, bool $use\_transliterate): string

[](#to_slugifystring-str-string-separator-string-language-string-replacements-bool-replace_extra_symbols-bool-use_str_to_lower-bool-use_transliterate-string)

[↑](#voku-php-readme-class-methods)Converts the string into an URL slug. This includes replacing non-ASCII characters with their closest ASCII equivalents, removing remaining non-ASCII and non-alphanumeric characters, and replacing whitespace with $separator. The separator defaults to a single dash, and the string is also converted to lowercase. The language of the source string can also be supplied for language-specific transliteration.

**Parameters:**

- `string $str`
- `string $separator [optional] The string used to replace whitespace.`
- `ASCII::* $language [optional] Language of the source string. (default is 'en') | ASCII::*_LANGUAGE_CODE`
- `array $replacements [optional] A map of replaceable strings.`
- `bool $replace_extra_symbols [optional]  Add some more replacements e.g. "£" with " pound ".`
- `bool $use_str_to_lower [optional] Use "string to lower" for the input.`
- `bool $use_transliterate [optional]  Use ASCII::to_transliterate() for unknown chars.`

**Return:**

- `string A string that has been converted to an URL slug.`

---

#### to\_transliterate(string $str, string|null $unknown, bool $strict): string

[](#to_transliteratestring-str-stringnull-unknown-bool-strict-string)

[↑](#voku-php-readme-class-methods)Returns an ASCII version of the string. A set of non-ASCII characters are replaced with their closest ASCII counterparts, and the rest are removed unless instructed otherwise.

EXAMPLE: `ASCII::to_transliterate('déjà σσς iıii'); // 'deja sss iiii'`

**Parameters:**

- `string $str The input string.`
- `string|null $unknown [optional] Character used for valid characters without a transliteration mapping. (default is '?') But you can also use NULL to keep those unknown chars. Malformed UTF-8 is discarded during cleaning.`
- `bool $strict [optional] Use "transliterator_transliterate()" from PHP-Intl`

**Return:**

- `string A String that contains only ASCII characters.`

---

Unit Test
---------

[](#unit-test)

1. [Composer](https://getcomposer.org) is a prerequisite for running the tests.

```
composer install

```

2. The tests can be executed by running this command from the root directory:

```
./vendor/bin/phpunit
```

### Support

[](#support)

For support and donations please visit [Github](https://github.com/voku/portable-ascii/) | [Issues](https://github.com/voku/portable-ascii/issues) | [PayPal](https://paypal.me/moelleken) | [Patreon](https://www.patreon.com/voku).

For status updates and release announcements please visit [Releases](https://github.com/voku/portable-ascii/releases) | [Twitter](https://twitter.com/suckup_de) | [Patreon](https://www.patreon.com/voku/posts).

For professional support please contact [me](https://about.me/voku).

### Thanks

[](#thanks)

- Thanks to [GitHub](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
- Thanks to [IntelliJ](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
- Thanks to [Travis CI](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there!
- Thanks to [StyleCI](https://styleci.io/) for the simple but powerful code style check.
- Thanks to [PHPStan](https://github.com/phpstan/phpstan) &amp;&amp; [Psalm](https://github.com/vimeo/psalm) for really great Static analysis tools and for discover bugs in the code!

### License and Copyright

[](#license-and-copyright)

Released under the MIT License - see `LICENSE.txt` for details.

###  Health Score

67

—

FairBetter than 100% of packages

Maintenance72

Regular maintenance activity

Popularity77

Solid adoption and visibility

Community43

Growing community involvement

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 65.9% 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 ~51 days

Recently: every ~258 days

Total

38

Last Release

544d ago

Major Versions

1.6.1 → 2.0.02022-01-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/6456fe693db197c458272cb758bf78958bc7d3e787ccd59db4bf3cf41654316a?d=identicon)[voku](/maintainers/voku)

---

Top Contributors

[![voku](https://avatars.githubusercontent.com/u/264695?v=4)](https://github.com/voku "voku (286 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (101 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (9 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (9 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (6 commits)")[![ilyahoilik](https://avatars.githubusercontent.com/u/7265704?v=4)](https://github.com/ilyahoilik "ilyahoilik (4 commits)")[![mkosturkov](https://avatars.githubusercontent.com/u/8509908?v=4)](https://github.com/mkosturkov "mkosturkov (3 commits)")[![Andr1yk0](https://avatars.githubusercontent.com/u/17598596?v=4)](https://github.com/Andr1yk0 "Andr1yk0 (2 commits)")[![eliyas5044](https://avatars.githubusercontent.com/u/13916443?v=4)](https://github.com/eliyas5044 "eliyas5044 (2 commits)")[![mend-bolt-for-github[bot]](https://avatars.githubusercontent.com/in/16809?v=4)](https://github.com/mend-bolt-for-github[bot] "mend-bolt-for-github[bot] (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (1 commits)")[![andreasschroth](https://avatars.githubusercontent.com/u/13320551?v=4)](https://github.com/andreasschroth "andreasschroth (1 commits)")[![daryush](https://avatars.githubusercontent.com/u/1227489?v=4)](https://github.com/daryush "daryush (1 commits)")[![deepsource-io[bot]](https://avatars.githubusercontent.com/in/16372?v=4)](https://github.com/deepsource-io[bot] "deepsource-io[bot] (1 commits)")[![dillingham](https://avatars.githubusercontent.com/u/29180903?v=4)](https://github.com/dillingham "dillingham (1 commits)")[![frost-cyber](https://avatars.githubusercontent.com/u/78665964?v=4)](https://github.com/frost-cyber "frost-cyber (1 commits)")[![gilbertoalbino](https://avatars.githubusercontent.com/u/992236?v=4)](https://github.com/gilbertoalbino "gilbertoalbino (1 commits)")[![aguingand](https://avatars.githubusercontent.com/u/17453506?v=4)](https://github.com/aguingand "aguingand (1 commits)")

---

Tags

asciihacktoberfestphpphp7stringtranslitphpasciiclean

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/voku-portable-ascii/health.svg)

```
[![Health](https://phpackages.com/badges/voku-portable-ascii/health.svg)](https://phpackages.com/packages/voku-portable-ascii)
```

###  Alternatives

[voku/portable-utf8

Portable UTF-8 library - performance optimized (unicode) string functions for php.

52322.4M40](/packages/voku-portable-utf8)[malios/php-to-ascii-table

A PHP library to generate plain text tables.

30118.8k1](/packages/malios-php-to-ascii-table)[povils/figlet

Figlet text generator - PHP

616.8k4](/packages/povils-figlet)[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)
