php如何去掉千分位
2022-12-02 09:01:16
210
{{single.collect_count}}

php去掉千分位的实现方法:首先打开相应的PHP代码;然后修改内容为【$product['price1']=$product['price1'];】;最后执行该PHP文件即可。

php入门到就业线上直播课:进入学习
Apipost = Postman + Swagger + Mock + Jmeter 超好用的API调试工具:点击使用

推荐:《PHP视频教程

具体问题:

php函数,一个产品价格是1500,现在网站显示的是1,500.00 怎么去掉千位分隔符,显示1500.00或者1500

函数如下,

$product['price1']=number_format($product['price1'],2);
登录后复制
登录后复制

解决办法:

$product['price1']=number_format($product['price1'],2);
登录后复制
登录后复制

这一行修改为$product['price1']=$product['price1'];

以上就是php如何去掉千分位的详细内容,更多请关注php中文网其它相关文章!

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}