Question about json parsing

Source: Internet
Author: User
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 .. ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.