如何使用php解析和创建JSON元组

I'm trying to create php-representations of Highcharts series in php+orm implementing the JsonSerializable Interface and then json_encode them into javascript in the view.

However the gradient for the fillColor uses a tuples array, which doesn't seem to have an equivalent in php, namely:

{stops: [
            [0, "rgba(40, 96, 144, 0.35)"],
            [1, "rgba(40, 96, 144, 0.0)"]
        ]
}

When I try to load this with json_decode I get an error JSON_ERROR_SYNTAX.

Is there some way to create the above json with json_encode in PHP or some alternative solution that would work with highcharts fillColor gradient.

{
    "stops": [
        [0, "rgba(40, 96, 144, 0.35)"],
        [1, "rgba(40, 96, 144, 0.0)"]
    ]
}

This is a valid json, the one you posted above isn't. stops should be in double quotes.

I use this link to validate my json when i am in doubt or can't figure where the problem is, you can try it :

Json Validator