I am working with an array that sometimes has a multidimensional array. I am trying to accomplish making this array into a single line array.
Array
(
[0] => Array
(
[attribute_code] => 203
[attribute_value] => Array
(
[0] => 24214
)
)
[1] => Array
(
[attribute_code] => 252
[attribute_value] => Array
(
[0] => 22865
[1] => 25086
)
)
)
This is what I am trying to accomplish
Array
(
[0] => {"attribute_code":"203","attribute_value":"24214"}
[1] => {"attribute_code":"252","attribute_value":["22865","25086"]}
)
What would the best way to accomplish this?