Number from MySQL database to be formated with comma

后端 未结 1 1407
抹茶落季
抹茶落季 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)
提交回复
热议问题