<?php
echo number_format("1000000")."<br>";
echo number_format("1000000",2)."<br>";
echo number_format("1000000",2,",",".");
?>
The number_format() function formats a number with grouped thousands.
Syntax
number_format(number,decimals,decimalpoint,separator)