I need to build an array look like this, that when you JSON.stringify in javascript it will look similar to this. How, please help
[{
name: 'Microsoft Internet Explorer',
id: 'Microsoft Internet Explorer',
data:[
['v11.0', 24.13],
['v8.0', 17.2],
['v9.0', 8.11],
['v10.0', 5.33],
['v6.0', 1.06],
['v7.0', 0.5]
]}
How is the right way to do it?
$arr[] = array('name' => 'example', 'y' => 25, 'drill' => 'test', 'data :' =>
'["test" =>25]' );
print_r $arr;
Also, I did this on my other part of code but its not nested. I cannot do it again because of the comma inside of the inner array is hard to trim out.
[]are arrays,{}are objects. So you'd need to create an array, with an object with those values.