【问题标题】:why does htmlentities() convert the symbol: ´ into ’? Shouldn't it convert into the html entity name: ´? [duplicate]为什么 htmlentities() 将符号:´ 转换为 ’?它不应该转换为html实体名称:'? [复制]
【发布时间】:2012-03-08 10:52:03
【问题描述】:

可能重复:
PHP htmlentities() not working as expected

我很困惑为什么它被转换成奇怪的字符而不是´ 谁能指出我正确的方向?

【问题讨论】:

    标签: php html


    【解决方案1】:

    使用第二个 flags 参数 - http://php.net/manual/en/function.htmlentities.php,例如

    htmlentities( $string, ENT_QUOTES | ENT_SUBSTITUTE, "UTF-8" );
    

    【讨论】:

      猜你喜欢
      • 2012-02-24
      • 2021-06-15
      • 1970-01-01
      • 2016-01-05
      • 2016-01-09
      • 2011-04-11
      • 2014-07-21
      • 1970-01-01
      相关资源
      最近更新 更多