Welcome Guest, Not a member yet? Register   Sign In
Character replacing inside a string
#3

[eluser]developer10[/eluser]
this is what i found on this issue and it works well when adapted to my case (at least for now):

Code:
$string = 'The quick brown fox jumped over the lazy dog.';
$patterns[0] = '/quick/';
$patterns[1] = '/brown/';
$patterns[2] = '/fox/';
$replacements[2] = 'bear';
$replacements[1] = 'black';
$replacements[0] = 'slow';
echo preg_replace($patterns, $replacements, $string);

thanks anyway, maybe i'll come back! Smile


Messages In This Thread
Character replacing inside a string - by El Forum - 12-05-2009, 10:13 AM
Character replacing inside a string - by El Forum - 12-05-2009, 10:30 AM
Character replacing inside a string - by El Forum - 12-05-2009, 10:32 AM
Character replacing inside a string - by El Forum - 12-05-2009, 11:10 AM
Character replacing inside a string - by El Forum - 12-05-2009, 11:13 AM
Character replacing inside a string - by El Forum - 12-05-2009, 06:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB