Sunday, 15 April 2012

php - Remove Double Quotes on Single JSON -



php - Remove Double Quotes on Single JSON -

i'm working highcharts , having little problem getting color variable work alternates colors.

here returned json array:

[{"y":5,"color":"colors[0]","drilldown":{"name":"june","categories":["fictional hospice","virtue hospice"],"data":[4,1],"color":"colors[3]"}}

i need remove double quotes colors[0] , colors[3] part in order work.

how go doing this?

thanks!

if want utilize references of colors array within json, that's not possible.

i rather utilize 0 , 3 in color property, , then, after decoding, utilize colors[myjson.color] right value out of color property.

so, json this:

{"y":5,"color": 0,"drilldown":{"name":"june","categories":["fictional hospice","virtue hospice"],"data":[4,1],"color": 3}}

and when want right color, utilize colors[jsonobject.color] instead of jsonobject.color if decoded json string jsonobject

php arrays json highcharts double-quotes

No comments:

Post a Comment