I have several questions about json parsing. I have several json strings: HTMLcode {& quot; clusterno & quot;: 167145108, & quot; clustertype & quot;: 1, & quot; subid & quot ;: & quot; 0 & quot;, & quot; newperson & quot;: & quot; ask a json parsing question
I have several json strings
HTML code
{"Clusterno": 167145108, "clustertype": 1, "subid": "0", "newperson": "welcome 【. dazuo. nickname. dayou.] to the group 【. dazuo. group name. dayou. ]. enter. information :. enter .. dazuo. information. dayou .. enter .. dazuo. number of group departures. dayou .. enter. change the group name card: the nickname of the gang name or gang name. enter. the name does not match. douhao. don't change to Hawaii... enter .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. jhao .. enter. \. douhao. \ is a robot. douhao. ignore it directly. "," removeperson ":" "," expdatetime ":" 2021-10-18 23:50:42 "," userid ":" 1 "," username ":" admin "," updatecode ": "7ECEDB4E1037476EAAF5FB5E8340AAEE "}
If json_decode is used for parsing, it will be null.
I tested it because the newperson contact is too long. Is there any way to solve this problem?
------ Solution --------------------
Backslash escape, conversion encoding
PHP code
------ Solution --------------------
Iconv is not required for UTF-8 encoded files. refer to the above section.
------ Solution --------------------
Discussion
Backslash escape, conversion encoding
PHP code
$ Json = '{"clusterno": 167145108, "clustertype": 1, "subid": "0", "newperson": "welcome 【. dazuo. nickname. dayou.] to the group 【. dazuo. group name. dayou. ]. enter. information :. enter .. dazuo. information. dayou .. enter .. dazuo. number of group departures. dayou .. ......