I have some values that grab off an API and store them into an array $data for insertion into my tables. However, I seem to have objects within the array $data, which seems kind of messy. Is it possible to convert all the contents of array $data into array elements?
PHP Code
$data['title'] = $item->ItemAttributes->Title;
$data['brand'] = $item->ItemAttributes->Brand;
$data['color'] = $item->ItemAttributes->Color;
echo "<pre>";
print_r($data);
Output
stdClass Object
(
[title] => stdClass Object
(
[0] => La Martina Polo Shirt Scotland Polo, Color: Black, Size: L
)
[brand] => stdClass Object
(
[0] => La Martina
)
[color] => stdClass Object
(
[0] => Black
)
)
I dont get you properly but if you do something like this
.. might lead you to something like below:-
But I am not sure if that is what you want