Twig filter to strip all diacritical signs from strings
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Tests
src
.gitignore
.travis.yml
LICENSE
README.md
composer.json
composer.lock
phpunit.xml.dist

README.md

nodiacritic

Build Status Total Downloads

Tiny helper function that removes all diacritical signs from characters. Function is aware of German and Danish diacritic particularities.

Installation

composer.json

"require": {
    "vria/nodiacritic": "0.*"
}

Use

use VRia\Utils\NoDiacritic;

$noDiacriticString = NoDiacritic::filter("Révolution française");

As expected, the result is Revolution francaise.

The library is aware of particularities in German and Danish language:

use VRia\Utils\NoDiacritic;

$noAccentsNiceStreet = NoDiacritic::filter("Schöne straße", "de");

The result is Schoene strasse.

The code is inspired by WordPress' remove_accents function.

You can find the article about the library in my blog.