DEV Community

Discussion on: Convert accentuated character to their ASCII equivalent in PHP

Collapse
 
suckup_de profile image
Lars Moelleken
<?php

$str = "À l'île, en été, quelle félicité !";

var_dump(transliterator_transliterate('NFKC; [:Nonspacing Mark:] Remove; NFKC; Any-Latin; Latin-ASCII', $str));

(3v4l.org/H3DAb)

If the "intl" php extension is not installed or you need something language specific you can also use this package: github.com/voku/portable-ascii

Collapse
 
bdelespierre profile image
Benjamin Delespierre

Nice job you did there!