微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – 在money_format函数中发生致命错误

为什么会出现此错误

码:

setlocale(LC_MONETARY,"en_US");
$pricetotal = money_format("%10.2n",$pricetotal);

服务器详情.

Apache Version : 2.2.21  
PHP Version : 5.3.8

我收到以下错误

Fatal error: Call to undefined function money_format()
manual

The function money_format() is only defined if the system has strfmon
capabilities. For example,Windows does not,so money_format() is
undefined in Windows.

money_format()基本上是作为手动状态的C库函数strfmon()的包装.

如果你查看评论,那就是an implementation by Rafael M. Salvioni.值得一试.您可以使用function_exists()检查是否已经定义.

this StackOverflow question的答案给出了更多的(甚至更好的)替代方案(thx danielson317).

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐