Function utf8_accents_to_ascii
Replace accented UTF-8 characters by unaccented ASCII-7 "equivalents". The purpose of this function is to replace characters commonly found in Latin alphabets with something more or less equivalent from the ASCII range. This can be useful for converting a UTF-8 to something ready for a filename, for example. Following the use of this function, you would probably also pass the string through utf8_strip_non_ascii to clean out any other non-ASCII chars Use the optional parameter to just deaccent lower ($case = -1) or upper ($case = 1) letters. Default is to deaccent both cases ($case = 0)
For a more complete implementation of transliteration, see the utf8_to_ascii package available from the phputf8 project downloads: http://prdownloads.sourceforge.net/phputf8
Author: Andreas Gohr <andi@splitbrain.org>
Located at vendor/joomla/string/src/phputf8/utils/ascii.php
Parameters summary
string |
$str |
UTF-8 string |
integer |
$case = 0 |
(optional) -1 lowercase only, +1 uppercase only, 1 both cases |
Return value summary
string
|
accented chars replaced with ascii equivalents |