我想在我的数字中使用逗号,如1234 = 1,234 123456 1,234,56等
这是代码....
<?php
//Get current count
$result = mysql_query("SELECT counter FROM profiles WHERE username='$username'") or
die("Unable to query database ! " . mysql_error());
//Add 1 to the count
$count = mysql_result($result, 0);
$count++;
//Update database with new value
mysql_query("UPDATE profiles SET counter = '$count' WHERE username='$username'") or
die("Unable to insert into database ! " . mysql_error());
?>
有什么想法吗?
答案 0 :(得分:1)
当您显示号码时,您想使用:
number_format($count);