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 ));