How to avoid this string and assign values to the array

Source: Internet
Author: User
How to process this string and assign values to the array? how to process this string: & quot; BronzeList & quot;: [], & quot; GoldList & quot;: [& quot; ATM 054000 & quot;], & quot; SilverList & quot;: [how to handle this string, assign a value to the array
How to handle this string:
"BronzeList": [], "GoldList": ["ATM 054000"], "SilverList": ["ATW099000"], "nation": "GER", "nationName ": "Germany", "rank": 1, "rankTotal": 1, "sortRank": 1, "sortRankTotal": 1, "totalBronze": 8, "totalGold": 8, "totalMedal": 22, "totalSilver": 6
To assign a value to the array $ array ($ key => $ value). use commas to separate the strings. each entry sets the content before the colon as the $ key of the array, the content after the colon is the $ value of the array.
The value of the array is: $ array = ("BronzeList" => null, "GoldList" => "ATM 054000", "SilverList" => "ATW099000 ", "nation" => "GER ",,,,)

Please help me.

------ Solution --------------------
Isn't it json?
------ Solution --------------------
PHP code
$ Json = '{"BronzeList": [], "GoldList": ["ATM 054000"], "SilverList": ["ATW099000"], "nation": "GER ", "nationName": "Germany", "rank": 1, "rankTotal": 1, "sortRank": 1, "sortRankTotal": 1, "totalBronze": 8, "totalGold": 8, "totalMedal": 22} '; print_r (json_decode ($ json, true ));

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.