I think the best solution would be to create a function, or you could use the str_replace function which does pretty much the same thing as preg_replace but takes us up less memory
PHP Code:
$haystack = "Dynamic Drive is the best site ever created";
$needle = "Dynamic";
$replacement = "cimanyD";
$haystack = str_replace($needle, $replacement, $haystack);
// output cimanyD Drive is the best site ever created
if you want you can create an "array" of needles to check for and replace them accordingly
PHP Code:
$haystack = "Detta är en länk till en sida."
$needles = array(
'ö' => 'ö',
'ä' => 'ä'
'å' => 'å'
);
foreach($needles as $needle => $replace)
{
$haystack = str_replace($needle, $replace, $haystack);
}
// output Detta är en länk till en sida.
Bookmarks