Number from MySQL database to be formated with comma

后端 未结 1 1408
抹茶落季
抹茶落季 2021-01-26 14:25

So i\'m currently running a php website that pulls data from a mysql database. At the moment i have a column, we can call this \"views\" the numbers that are in this column are

相关标签:
1条回答
  • 2021-01-26 15:28

    Is this what you are looking for?

    http://php.net/manual/pt_BR/function.number-format.php

    number_format( $views, 0 , "." , "," );
    

    No decimal places. Dot for decimal point, comma for thousands separator.

    0 讨论(0)
提交回复
热议问题