PHP:使用函数number_format的数字格式[关闭]

I have a very simple question regarding the number format.

I have this number 12456 and I would like to format as a price EUR 12 456

I found this script

number_format($number, 2, ',', ' ')

and the result is 12 456.00 How can I obatin 12 456 using the same function number_format()?

Have a look at the documentation. Note: what you have found (number_format) is a string function, not a script.

Why not try to change the '2' to '0' like this?

number_format($number, 0, ',', ' ')

If you want to get 12 456 try: number_format($number, 0, '', ' ');