比如说24转成twenty-four
需要打开 intl 扩展
使用方法:
<?php
$f = new NumberFormatter("en", NumberFormatter::SPELLOUT);
echo $f->format(123456);
?>
Produces the result:
one hundred twenty-three thousand four hundred fifty-six
php官方文档:https://www.php.net/manual/en/class.numberformatter.php
网友评论