Hi all,
I'm trying to replace string "Red Dwarf (TV Series 1988â€") - IMDb" to "Red Dwarf (TV Series 1988') - IMDb"
I have a translation table of these funny characters in an array. I tried to replace them using: str_replace but it did not work. Can anybody suggest a workaround on this? This is the snippet of the code:
function replaceFunnyChar( $input ){
$translation = array(
'’' => "'",
"â€\"" => '-',
'é' => 'é',
'è' => 'è',
'“' => '"',
'â€' => '"',
'‘' => "'",
'â' => 'ã',
'Ã"' => 'ä',
'â€"' => '–',
'Ä«' => 'ī',
'阴' => '阴',
'é™°' => '陰',
"阳" => "阳",
"陽" => "陽",
'´' => "'",
'ü' => 'ü',
"Ã,Ã'" => "'",
'•' => '–'
);
foreach( $translation as $find => $replace ){
$output = str_replace($find, $replace, $input );
//$output = preg_replace("/" . $find . "/", $replace, $input );
}
return $output;
}