How to split a part from a number Group as a new array. Array (& nbsp; [totalcount] & gt; 2 & nbsp; [errorcount] & gt; 0 & nbsp; [orderlist] & gt; Array & nbsp; (& nbsp; [order] & gt; Array & nbsp how to split a part from a number Group as a new Array.
Array
(
[Totalcount] => 2
[Errorcount] => 0
[Orderlist] => Array
(
[Order] => Array
(
[0] => Array
(
[Orderamount] = & gt; 130.0
[Ordercode] = & gt; 11111009 FTHT
[Ordercreatetime] => 2011-11-11 20:44:32
[Orderdeliveryy] => 0.0
[Orderid] = & gt; 21919876
[Orderneedinvoice] => 0
[Orderstatus] => ORDER_OUT_OF_WH
[Productamount] = & gt; 130.0
)
[1] => Array
(
[Orderamount] = & gt; 200.0
[Ordercode] = & gt; 3311009 FTHT
[Ordercreatetime] => 20:44:32
[Orderdeliveryy] => 0.0
[Orderid] = & gt; 21919876
[Orderneedinvoice] => 0
[Orderstatus] => ORDER_OUT_OF_dfd
[Productamount] = & gt; 130.0
)
)
)
[Encoding] => UTF-8
)
I need the part in [order] to propose this array as a new array. how can this problem be solved.
------ Solution --------------------
$ New_arr = $ all_arr ['order'];
------ Solution --------------------
Suppose $ arr is your original array.
$ NewArr = $ arr ['order'];
------ Solution --------------------
The two upstairs did not see the array structure clearly:
PHP code
// Modify the required array $ newArr = $ arr ['orderlist'] ['order']; // If you need to merge the modified result into the original array: $ arr ['orderlist'] ['order'] = $ newArr;