<?php
$array = [
[
'price' => [
'cost' => 200, 'tax' => 10, 'total' => 210
],
'otherKey' => 'etc'
],
[
'price' => [
'cost' => 500, 'tax' => 50, 'total' => 550
],
'otherKey' => 'etc'
],
[
'price' => [
'cost' => 600, 'tax' => 60, 'total' => 660
],
'otherKey' => 'etc'
],
];
var_export(
array_column(
array_column(
$array,
'price'
),
'total'
)
);
- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- array (
0 => 210,
1 => 550,
2 => 660,
)
preferences:
115.21 ms | 402 KiB | 91 Q