- array_map: documentation ( source)
- var_dump: documentation ( source)
<?php
$buy_restrictions = array (
0 =>
array (
'type' => '3',
'value' => '314',
),
1 =>
array (
'type' => '3',
'value' => '571',
),
);
$buyRestrictions = array_map(function($e){ return $e['type'] == 3 ? $e['value'] : 0;}, $buy_restrictions);
var_dump($buyRestrictions);