granam / remove-diacritics
Cleanse text from diacritics and special characters
Installs: 131
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.4
- ext-intl: *
- ext-mbstring: *
- granam/scalar: ^5.1
- granam/strict-object: >=3.0
- granam/string: ^4.1
Requires (Dev)
- granam/exceptions-hierarchy: ^5.0
- mockery/mockery: >=1.2
- phpunit/phpunit: >=9.0
README
<?php use Granam\RemoveDiacritics\RemoveDiacritics; // SIMPLE DIACRITICS REMOVAL $portuguese = 'Luís argüia à Júlia que «brações, fé, chá, óxido, pôr, zângão» eram palavras do português.'; echo RemoveDiacritics::removeDiacritics($portuguese); // 'Luis arguia a Julia que «bracoes, fe, cha, oxido, por, zangao» eram palavras do portugues.' $greece = 'Α α άλφα'; echo RemoveDiacritics::removeDiacritics($greece); // 'A a alpha' // CONSTANT-LIKE CONVERSIONS $danish = 'Høj bly gom vandt fræk sexquiz på wc'; echo RemoveDiacritics::toConstantLikeValue($danish); // 'hoj_bly_gom_vandt_fraek_sexquiz_pa_wc' // NAMESPACED-NAMES TO snake_case $classLikeName = 'Foo\\Bar::IHave_VIPCombinationsBAZ'; echo RemoveDiacritics::camelCaseToSnakeCasedBasename($classLikeName); // 'i_have_vip_combinations_baz'
And more, see \Granam\Tests\RemoveDiacritics\RemoveDiacriticsTest for capabilities and results.