Php/MySql array search with ã, š, é, ë, ú, ü, í, ž

*爱你&永不变心* 提交于 2019-12-13 13:02:54

问题


Hi everybody
If someone search for term "zali se mami" in mySql database, what is the best way to make all possible replacements with appropriate signs (for example e => ë, e => é, a => ã, u => ü, u => ú...) so he/she could get all possible results like:
"žali se mami"
"žali se màmi"
"žàli se mami"
"žàli së mami"

Thank you in advance for your help


回答1:


Use the utf8_general_ci collation on the column. You can read more about the effects of the collation at these two pages in the MySQL manual:

Unicode Character Sets and Examples of the Effect of Collation



来源:https://stackoverflow.com/questions/6081087/php-mysql-array-search-with-%c3%a3-%c5%a1-%c3%a9-%c3%ab-%c3%ba-%c3%bc-%c3%ad-%c5%be

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!