I have a string that looks like this:
{"red":216.77,"blue":0.669,"green":0.545,"alpha":1}
I want to save it in either an array like this:
array(
"red" => 216.77,
"blue" => 0.669,
green" => 0.545,
"alpha" => 1
)
or some other structure (like stdclass) containing name-value pairs, so that I can traverse it and retrieve values by names.
How can I do that?