byjg / convert
A lightweight utility for string conversion between text from UTF8 to a lot of formats and vice-versa.
Fund package maintenance!
byjg
Installs: 44 659
Dependents: 3
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: >=8.1 <8.4
Requires (Dev)
- phpunit/phpunit: ^9.6
- vimeo/psalm: ^5.9
README
A lightweight utility for string conversion between text from UTF8 to a lot of formats and vice-versa.
Examples
<?php $str = \ByJG\Convert\ToUTF8::fromHtmlEntities('João'); echo $str; // João $str2 = \ByJG\Convert\FromUTF8::toHtmlEntities('João'); echo $str2; // João $str3 = \ByJG\Convert\FromUTF8::removeAccent('João'); echo $str3; // Joao $str4 = \ByJG\Convert\FromUTF8::toIso88591Email('João'); echo $str4; // =?iso-8859-1?Q?Jo=E3o?= $str5 = \ByJG\Convert\FromUTF8::onlyAscii('João'); echo $str5; // Joao // https://en.wikipedia.org/wiki/Combining_character $str6 = \ByJG\Convert\ToUTF8::fromCombiningChar($combining); echo $str6;
Install
Just type:
composer install "byjg/convert"
Running Tests
vendor/bin/phpunit