<?php
$arr =array( "20" => Array
(
"ean" => "**6900532615069**",
"productPrice" => 1140,
"productCount" => 50
),
"25" => Array
(
"ean" => 6900535364122,
"productPrice" => 1140,
"productCount" => 50
),
"36" => Array
(
"ean" => "**6900532615069**",
"productPrice" => 1140,
"productCount" => 10,
));
$arr = array_values(array_column($arr, NULL, "ean"));
var_dump($arr);
- Output for 7.1.0 - 7.1.21, 7.2.0 - 7.2.33, 7.3.16 - 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.19, 8.3.0 - 8.3.7
- array(2) {
[0]=>
array(3) {
["ean"]=>
string(17) "**6900532615069**"
["productPrice"]=>
int(1140)
["productCount"]=>
int(10)
}
[1]=>
array(3) {
["ean"]=>
int(6900535364122)
["productPrice"]=>
int(1140)
["productCount"]=>
int(50)
}
}
preferences:
107.63 ms | 404 KiB | 171 Q