【问题标题】:need SQL query to replace foreign language characters from string需要 SQL 查询来替换字符串中的外语字符
【发布时间】:2015-07-22 22:13:54
【问题描述】:

CodeIgniter 不允许在 URL 中使用外语字符
您提交的 URI 包含不允许的字符。

http://allvideolectures.com/v/R4717Cf87j/QM41-Potential-Barrier-E-â-V-The-scattering-problem

我已将 ID 创建为 QM41-Potential-Barrier-E-Ⅴ-The-scattering-problem 其中一些包含需要替换为普通字符的外来字符

我尝试使用 php strtr() 函数解决问题,但由于 List 很长,未能得到正确的结果
如果有的话,我需要 Direct SQL 解决方案

【问题讨论】:

    标签: php mysql codeigniter


    【解决方案1】:

    将高位 ASCII 字符转译为低位 ASCII 字符,这在需要使用非英文字符且仅安全使用标准 ASCII 字符时很有用,例如在 URLs.try 中,

    $string = convert_accented_characters($string);
    

    【讨论】:

      猜你喜欢
      • 2023-02-23
      • 2014-07-03
      • 2023-03-08
      • 2012-05-13
      • 2015-02-15
      • 2020-06-09
      • 1970-01-01
      • 1970-01-01
      • 2013-09-22
      相关资源
      最近更新 更多