I have urlencoded JSON data:
%5B%5B"Task"%2C"Hours%20per%20Day"%5D%2C%5B"Work"%2C11%5D%2C%5B"Eat"%2C2%5D%2C%5B"Commute"%2C2%5D%2C%5B"Watch%20TV"%2C2%5D%2C%5B"Sleep"%2C7%5D%5D
I have already decoded it to:
"[["Task","Hours per Day"],["Work",11],["Eat",2],["Commute",2],["Watch TV",0.5],["Sleep",7]]"
As you can see, this is a string, not an array, and I am trying to convert it to an array.
Sidenote:
I am making a page which will display charts using Google Charts that is having this problem. All help is welcome!
eval
is your friend – adeneo Mar 28 at 21:13eval
is actually your enemy, use it wisely or never at all. This case is not a wise case to use it since the input is likely from a URL, which could be spoofed for phishing and you'd be subject to script injection. – Juan Mendes Mar 28 at 21:19