fork download
  1. <?php
  2.  
  3. $http_lang = isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,5) : '';
  4.  
  5. $http_lang = str_replace("-","_",$http_lang);
  6.  
  7. setlocale(LC_ALL, $http_lang);
  8.  
  9. $locale_info = localeconv();
  10.  
  11. $simbolo = $locale_info['currency_symbol'];
  12. $decimal_point = $locale_info['decimal_point'];
  13. $thousands = $locale_info['thousands_sep'];
  14.  
  15. $valor = 12345678900;
  16.  
  17. echo $simbolo.number_format($valor,2,$decimal_point,$thousands);
Success #stdin #stdout 0.02s 23648KB
stdin
Standard input is empty
stdout
$12,345,678,900.00