I have this PHP snippet:
<?php $colors = array('red','green','blue'); foreach ($colors as &$item) { $item = 'color-'.$item; } print_r($colors); ?> Output:
Array ( [0] => color-red [1] => color-green [2] => color-blue ) Is it simpler solution ?
(some array php function like that array_insert_before_all_items($colors,"color-"))?
Thanks