php 数字格式化

2019-07-18  本文已影响0人  cuihaomaster

比如说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

上一篇 下一篇

猜你喜欢

热点阅读