<?php
$purchases = array(
array('product_id' => 7, 'receipt' => 'R13D13'),
array('product_id' => 5, 'receipt' => 'Y28Z14'),
array('product_id' => 7, 'receipt' => 'R02310'),
array('product_id' => 5, 'receipt' => 'E11403')
);
$arr = array_values(array_column($purchases, null, "product_id"));
print_r($arr);
- Output for 7.1.25 - 7.1.31, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
- Array
(
[0] => Array
(
[product_id] => 7
[receipt] => R02310
)
[1] => Array
(
[product_id] => 5
[receipt] => E11403
)
)
preferences:
134.68 ms | 403 KiB | 173 Q