- var_dump: documentation ( source)
- in_array: documentation ( source)
- array_walk: documentation ( source)
<?php
$bonusProgramShops = array(
1 => array(
'name' => 'test1',
),
2 => array(
'name' => 'test2',
),
);
$customerOnShops = array(1);
array_walk( $bonusProgramShops, function( &$shop, $shopId ) use ( $customerOnShops )
{
if ( ! in_array( $shopId, $customerOnShops ) )
{
return;
}
$shop['sameple'] = 'testing';
} );
var_dump( $bonusProgramShops );