note 27200 deleted from function.strtr by cmb
| From: | cmb@php.net | Date: | Sun, 29 Dec 2019 10:03:50 +0000 |
| Subject: | note 27200 deleted from function.strtr by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213655@lists.php.net to get a copy of this message | ||
Note Submitter: hotmail - marksteward
----
Referring to note from 11 October 2000, Thorn (Þ, þ), Eth (Ð, ð), Esset (ß) and Mu (µ)
aren't really accented letters. , , Æ, æ are ligatures. Best to do the following:
function removeaccents($string){
return strtr(
strtr($string,
'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ',
'SZszYAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy'),
array('Þ' => 'TH', 'þ' => 'th', 'Ð'
=> 'DH', 'ð' => 'dh', 'ß' => 'ss',
'' => 'OE', '' => 'oe', 'Æ' =>
'AE', 'æ' => 'ae', 'µ' => 'u'));
}
This would be no good for sorting, as thorn and eth aren't actually found under th and dh.
Also especially redundant because of Unicode! Still, I'm sure somone can find use for it -
perhaps to constrict filenames...
Mark