PHP json_encode returns null value from unicode character

后端 未结 1 546
夕颜
夕颜 2020-12-07 04:22

I have the following array:

Array
(
    [BookDateID] => 4
    [HotelName] => Adams’ Inn
)

Output:

{\         


        
相关标签:
1条回答
  • 2020-12-07 04:58

    json_encode needs UTF-8 encoded data. Make sure the data is UTF-8 encoded; currently it's likely Latin-1 encoded. How to do this depends on where the data comes from. Read What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text and Handling Unicode Front To Back In A Web App.

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