我需要用url字符串中的小ascii字符替换所有本地字符(包括大写)。str_ireplace作为str_replace工作
$str = "č-ć-đ-š-ž-Č-Ć-Đ-Š-Ž";
echo str_ireplace(array('č', 'ć', 'đ', 'š', 'ž'), array('c', 'c', 'd', 's', 'z'), $str);
结果 - c-c-d-s-z-Č-Ć-Đ-Š-Ž
我预想 - c-c-d-s-z-c-c-d-s-z
如何获得使用str_ireplace()
函数预期的结果。
可能重复[如何在PHP中替换字符串中的非ASCII字符?](https://stackoverflow.com/questions/25236761/how-to-replace-non-ascii-characters-in-a -string-in-php) – Marten
@Marten,它不重复。我的问题特别是关于'str_ireplace'函数。 – bonaca