I was looking for some standard PHP function to replace some value of an array with other, but surprisingly I haven\'t found any, so I have to write my own:
What about array_walk() with callback?
array_walk()
$array = ['*pasta', 'cola', 'pizza']; $search = '*'; $replace = '\*'; array_walk($array, function (&$v) use ($search, $replace){ $v = str_replace($search, $replace, $v); } ); print_r($array);