📌  相关文章
📜  将阿拉伯数字更改为英文 php 代码示例

📅  最后修改于: 2022-03-11 14:53:48.655000             🧑  作者: Mango

代码示例1
function convert($string) {
    $persian = ['Û°', 'Û±', 'Û²', 'Û³', 'Û´', 'Ûµ', 'Û¶', 'Û·', 'Û¸', 'Û¹'];
    $arabic = ['Ù©', 'Ù¨', 'Ù§', 'Ù¦', 'Ù¥', 'Ù¤', 'Ù£', 'Ù¢', 'Ù¡','Ù '];

    $num = range(0, 9);
    $convertedPersianNums = str_replace($persian, $num, $string);
    $englishNumbersOnly = str_replace($arabic, $num, $convertedPersianNums);

    return $englishNumbersOnly;
}