str_replace
Posted: Sun Oct 05, 2008 12:56 am
btw, which one is faster when using str_replace
or
thanks 
Code: Select all
$test = array("1"=> "one", "2" => "two");
$string = "1 2";
str_replace(array_keys($test), array_values($test), $string);
Code: Select all
$test = array("1"=> "one", "2" => "two");
$string = "1 2";
foreach ($test as $key => $value) {
str_replace($key , $value, $string);
}