I have string that look like Array that fetched from other webservice like this
[
[
[189, 'Brazil Serie A', 0, ''],
[
[1053230, 'Flamengo', 'Atletico Goianiense', '1.196', 10, '07/02/2012 04:30', 0, 9, 1, 0, '', 0]
],
[0, [
[10770901, 0, 5000.00],
[1, 17988654, '-0.78', '0.70', '1.0', 1],
[3, 17965783, '0.97', '0.93', '2.5-3'],
[7, 17965787, '-0.89', '0.77', '0.50', 1],
[9, 17965789, '0.70', '-0.82', '1.0']
]]
],
[, , [0, [
[10748028, 0, 3000.00],
[1, 17965781, '0.85', '-0.93', '0.5-1', 1],
[3, 17988655, '0.79', '-0.89', '2.50']
]]]
]
Is it possible to parsing to PHP Array or convert to JSON ?
As ctrahey noted, the single quotes need to be swapped to double quotes to be valid JSON. The commas without anything preceding them also have to go.
I’ve tried to keep it simple and build a little flexibility in.