Convert Unicode from JSON string with PHP

后端 未结 3 1080
挽巷
挽巷 2020-12-18 03:26

I\'ve been reading up on a few solutions but have not managed to get anything to work as yet.

I have a JSON string that I read in from an API call and it contains Un

3条回答
  •  北海茫月
    2020-12-18 04:08

    The output is correct.

    \u00c2 == Â
    \u00a3 == £
    

    So nothing is wrong here. And converting to HTML entities is easy:

    htmlentities($title);
    

提交回复
热议问题