$str = str_replace ('–', '-', $str);
does not work (the longer Unicode dash character is not replaced with minus character, as I want.
$str is read from a database and should be in UTF-8.
PHP code is run from an Apache server.
I need to replace all these long dashes with minus char.
$dash = "–"; echo "string: " . bin2hex($str) . ", dash: " . bin2hex($dash) . "\n"; echo "string: " . $str . ", dash: " . $dash . "\n"; string: 5a656c626f726166202623383231313b20d0bdd0bed0b2d18bd0b920d0bfd180d0b5d0bfd0b0d180d0b0d18220d0b4d0bbd18f20d0bbd0b5d187d0b5d0bdd0b8d18f20d0bcd0b5d0bbd0b0d0bdd0bed0bcd18b, dash: e28093 string: Zelboraf – новый препарат для лечения меланомы, dash: –
What is wrong (not in proper UTF-8): string or dash?