How can I do a test in PHP to compare two words (one with accent) and detect that is the same word ?
e.g pensé vs pense
Basically I told it to load certain words from MySQL table, and with MySQL collation settings it loads both versions from db, which is fine, but I want PHP to detect them as the same word too (Like MySQL does in this particular situation).
I assume in PHP it can be done with the collator class but I don't understand how it works.
As you mentioned, you can use the PHP
Collatorclass.Collatoris part of intl extension - make sure your PHP has intl extension enabledIf you are using multiple different languages:
Set a general use locale:
$collator = new Collator('root');Dynamically switch locale if the language context is known, for example a user has a specific language set.
This would look something like this: