Make PHP pathinfo() return the correct filename if the filename is UTF-8

后端 未结 7 861
庸人自扰
庸人自扰 2020-12-06 04:07

When using PHP\'s pathinfo() function on a filename known to be UTF-8, it does not return the correct value, unless there are \'normal\' characters in front of

相关标签:
7条回答
  • 2020-12-06 04:52

    As the doc shows,

    Caution

    pathinfo() is locale aware, so for it to parse a path containing multibyte characters correctly, the matching locale must be set using the setlocale() function.

    and the example in the manual

    0 讨论(0)
提交回复
热议问题