I have an array comprising months (keys) and values See shortened example below. It is being generated by a legacy client system so I can only manipulate what I am presented with (not ideal).
$cost_data= array
(
[9] => 1110
[10] => 111
[8] => 100
[7] => 200
[6] => 690
[11] => 222
)
Note-the non linear keys represent months of the year.
I need to change the data structure to the format below and am not having much luck after several hours of trying different approaches and searching.
$cost_data = array
(
array("9",1110),
array("10",111),
array("8",100),
array("7",200),
array("6",690),
array("11",222)
);
Is there a simple built in function or does anyone know a neat method for achieving this transformation?
print_rdump (string)? and then convert into array data type?several hours of trying different approaches, but don't include at least one of those different approaches? Why should we help when you don't actually show any effort other than posting?