Code:
<?php

$number = 50000000;

echo number_format($number,0,'.',','); 

?>