Looping through array updating values PHP
arrays, loops, php
Solution
foreach ($info as $key => $value)
$info[$key] = str_replace('%value%', 'MyValue', $value);
Demo: http://ideone.com/65F3L
Problem
say I have an array in php like this ``` $info['name'] = 'test %value%'; $info['city'] = 'city test %value%'; $info['other'] = '%value% city test'; ``` all I want to do is loop through this array and replace all the instances of %value% with a supplied string, saving it into the same array. What would be the best way to do that? :) Thanks