php - Using simple foreach loop instead of foreach with key=>value in Yii2

one text

Solution:

As @Qirel mentioned you should pass it as reference but also you have to do something with the result of str_replace:

foreach ($slideShow as &$slide){
    $slide['image'] = str_replace('_xs', '', $slide['image']);
}

Source