- var_dump: documentation ( source)
- array_column: documentation ( source)
<?php
$promos = [
'123' => ['id' => '123', 'weight' => 1],
'234' => ['id' => '234', 'weight' => 3],
'345' => ['id' => '345', 'weight' => 2],
];
var_dump(array_column($promos, 'weight', 'id'));