Why cannot the returned json be converted into an array?-php Tutorial

Source: Internet
Author: User
Why can't the returned json data be converted into an array?
({"Name": "liang", "data": "fffff automatically replies to the system:
[11:31:59] the agent has received the goods and is waiting for receiving the goods. [Mel]
[] The goods have been imported into the warehouse [MEL]
[] The goods are equipped with flights and sent to the designated port 44444 [MEL]
[] The goods have arrived at the customs clearance port. Please wait for [China]
[] Scanning for collection in Guangdong Dongguan distribution center
[] The loading scanning will be carried out at the distribution center in Dongguan, Guangdong province, and will be sent to the distribution center in Chengdu, Sichuan province.
[] Conduct a gossip scan at the dial-up center in Chengdu, Sichuan province
[] A parcel scan is performed at the Chengdu distribution center in Sichuan.
[] From Chengdu sub-Distribution Center, Sichuan province, this transshipment destination: Sichuan Chengdu Pixian company
[] Express parcels will be delivered soon when you arrive at the destination outlets of Sichuan Chengdu Pixian company.
[] Arrived at the destination outlet Sichuan Chengdu Pixian company Hengchuang branch, express delivery will soon be delivered
[] A dispatching scan was conducted in Hengchuang branch of Sichuan Chengdu Pixian County company. The dispatching salesman: Wang 22211111; Contact number: 11111111111
[] The courier was scanned by the Hengchuang branch of Sichuan Chengdu Pixian County company.
"})


$ Curl = curl_init ();
Curl_setopt ($ curl, CURLOPT_URL, $ query_link );
Curl_setopt ($ curl, CURLOPT_HEADER, 0 );
Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ curl, CURLOPT_USERAGENT, $ _ SERVER ['http _ USER_AGENT ']);
Curl_setopt ($ curl, CURLOPT_TIMEOUT, 5 );
$ Get_content1 = curl_exec ($ curl );

$ Get_content2 = json_decode ($ get_content1 );

Print_r ($ get_content2 );
Print_r ($ get_content1 );

Exit ();

Get_content2 is a null value. why cannot it be converted.


Reply to discussion (solution)

Code missing !!

Function for reading content

The data you posted is enclosed in parentheses! The format is not correct, so it cannot be decoded.

Is there a format problem with the printed data you returned?


What is it that filters out or escapes it \

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.