标签: php number-formatting
我有input来显示价格:
input
<input type='text' name='price' value='1000000'/>
我想展示1,000,000。
1,000,000
答案 0 :(得分:0)
您可以使用number_format():
number_format()
$price = 1000000; echo number_format($price, 0, '', ','); // 1,000,000