3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cart_array = json_decode('{ "items":[ { "count":"1", "cart_id":123, "plu":"TP16", "description":"Bag" }, { "count":1, "cart_id":1234, "plu":"DISCT10", "description":"10% Discount" } ], "total":9.9, "discount_total":9.9 }', true); $cart_array['items'] = array_column($cart_array['items'], NULL, 'cart_id'); Var_dump($cart_array);

preferences:
27.25 ms | 406 KiB | 5 Q