Last Updated: May 31, 2021
·
799
· mihailoff

Iterate over array in one row

Instead of two rows

foreach($arr as $item)
    $obj->processItem($item);

You may use this

array_walk($arr, array($obj, 'processItem'));