How to detach a part from an array as a new array.
Array
(
[TotalCount] = 2
[Errorcount] = 0
[OrderList] = = Array
(
[Order] = Array
(
[0] = = Array
(
[OrderAmount] = 130.0
[Ordercode] = 11111009FTHT
[Ordercreatetime] = 2011-11-11 20:44:32
[Orderdeliveryfee] = 0.0
[OrderID] = 21919876
[Orderneedinvoice] = 0
[Orderstatus] = ORDER_OUT_OF_WH
[Productamount] = 130.0
)
[1] = = Array
(
[OrderAmount] = 200.0
[Ordercode] = 3311009FTHT
[Ordercreatetime] = 2011-05-11 20:44:32
[Orderdeliveryfee] = 0.0
[OrderID] = 21919876
[Orderneedinvoice] = 0
[Orderstatus] = ORDER_OUT_OF_DFD
[Productamount] = 130.0
)
)
)
[Encoding] = UTF-8
)
This array I need to [order] inside the part proposed as a new array, how to deal with it.
------Solution--------------------
$new _arr = $all _arr[' order '];
------Solution--------------------
Assume that $arr is your original array.
$NEWARR = $arr [' Order '];
------Solution--------------------
Upstairs two people did not see clearly the array structure:
PHP Code
Modify the required array $newarr= $arr [' orderlist '] [' order '];//if you need to merge the modified results back into the original array: $arr [' orderlist '] [' order ']= $newArr;