Remove non-utf8 characters from string

后端 未结 18 1852
心在旅途
心在旅途 2020-11-22 11:56

Im having a problem with removing non-utf8 characters from string, which are not displaying properly. Characters are like this 0x97 0x61 0x6C 0x6F (hex representation)

18条回答
  •  天命终不由人
    2020-11-22 12:34

    How about iconv:

    http://php.net/manual/en/function.iconv.php

    Haven't used it inside PHP itself but its always performed well for me on the command line. You can get it to substitute invalid characters.

提交回复
热议问题