PHP json_encode json_decode UTF-8

前端 未结 10 836
温柔的废话
温柔的废话 2020-12-01 07:45

How can I save a json-encoded string with international characters to the databse and then parse the decoded string in the browser?



        
10条回答
  •  自闭症患者
    2020-12-01 08:39

    If your source-file is already utf8 then drop the utf8_* functions. php5 is storing strings as array of byte.

    you should add a meta tag for encoding within the html AND you should add an http header which sets the transferencoding to utf-8.

    
    
       
    

    and in php

提交回复
热议问题