PHPのオブジェクトを配列に変換。
stackoverflowで面白い回答を見つけた。
$array = json_decode(json_encode($object), true);
一度jsonにして、decodeするときにtrueをつければ配列になる。
参考
php stdClass to array
http://stackoverflow.com/questions/18576762/php-stdclass-to-array
More than 5 years have passed since last update.
PHPのオブジェクトを配列に変換。
stackoverflowで面白い回答を見つけた。
$array = json_decode(json_encode($object), true);
一度jsonにして、decodeするときにtrueをつければ配列になる。
php stdClass to array
http://stackoverflow.com/questions/18576762/php-stdclass-to-array
Register as a new user and use Qiita more conveniently