加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 数据库 > MySql > 正文

php – 如何将逗号放入计数数字?

发布时间:2020-05-23 18:58:55 所属栏目:MySql 来源:互联网
导读:嘿,我用这段代码计算我的表:$county = mysql_query(SELECT COUNT(id) from table where type = application); $county = mysql_result($county, 0); $applications = .$county.; 这给我的结果像1156563.但我希

嘿,我用这段代码计算我的表:

$county = mysql_query("SELECT COUNT(id) from table where type = 'application'");
$county = mysql_result($county,0);
$applications = ''.$county.'';

这给我的结果像1156563.但我希望看到它像1,156,563逗号.我怎样才能做到这一点? 最佳答案 number_format()应该是你需要的

If only one parameter is given,number
will be formatted without decimals,
but with a comma (“,”) between every
group of thousands.

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读