对象型数组转换为普通数组

摘要:简单的将对象型数组转换为普通数组,不适用遍历等操作

一般说道对象换为数组,都会是用遍历,但是影响系统性能同时加载速度也会降低,现在提供一个可行的办法

1、将对象json
2、json_decode
代码如下

            $a = $response->Instances->Instance;
            $b = json_encode($a);
            $test = json_decode($b,TRUE);
            dump($test);
评论