Possible Duplicate:
Converting array and objects in array to pure array
I have an array at the moment but it is being passed to another function which is converting it to objects, for it to work though it needs to be a standard array. I need to convert the following object array to a standard array:
[files] => stdClass Object
(
[1] => stdClass Object
(
[name] => price-my-insurance.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpfmRfyN
[error] => 0
[size] => 911376
)
[2] => stdClass Object
(
[name] => sideshows.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpTamdHy
[error] => 0
[size] => 967656
)
[3] => stdClass Object
(
[name] => the-beer-scale.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpwCmwlW
[error] => 0
[size] => 742219
)
[4] => stdClass Object
(
[name] => the-little-lace.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpFnUuf8
[error] => 0
[size] => 939963
)
[5] => stdClass Object
(
[name] => varrstoen-australia.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpUtWyk1
[error] => 0
[size] => 2204400
)
)
to this:
Array
(
[1] => Array
(
[name] => price-my-insurance.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpfmRfyN
[error] => 0
[size] => 911376
)
[2] => Array
(
[name] => sideshows.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpTamdHy
[error] => 0
[size] => 967656
)
[3] => Array
(
[name] => the-beer-scale.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpwCmwlW
[error] => 0
[size] => 742219
)
[4] => Array
(
[name] => the-little-lace.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpFnUuf8
[error] => 0
[size] => 939963
)
[5] => Array
(
[name] => varrstoen-australia.jpg
[type] => image/jpeg
[tmp_name] => /Applications/MAMP/tmp/php/phpUtWyk1
[error] => 0
[size] => 2204400
)
)
I'm stuck on the foreach loop to do this.
EDIT: