重複の可能性:
配列と配列内のオブジェクトを純粋な配列に変換する
私は現在配列を持っていますが、それが標準の配列である必要がありますが、それが機能するために、それをオブジェクトに変換している別の関数に渡されています。次のオブジェクト配列を標準配列に変換する必要があります。
[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
)
)
これに:
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
)
)
私はこれを行うためにforeachループで立ち往生しています。
編集: