通常は、get_object_vars($obj)
でオブジェクトの中身が配列で取得できる。
問題は、これで下記のようなエラーが発生する場合。
Allowed memory size of xxxxxxxxx bytes exhausted
そんなときは、下記でできるかも。(自分はできた。)
json_decode(json_encode($obj), true)
More than 5 years have passed since last update.
通常は、get_object_vars($obj)
でオブジェクトの中身が配列で取得できる。
問題は、これで下記のようなエラーが発生する場合。
Allowed memory size of xxxxxxxxx bytes exhausted
そんなときは、下記でできるかも。(自分はできた。)
json_decode(json_encode($obj), true)
Register as a new user and use Qiita more conveniently