格式编号用点而不是逗号作为千位分隔符

If I use number_format to format a number like this:

$price = 1500;
echo number_format($price);

Then I get output like this: 1,500

How can I make the thousands separator be a dot instead of a comma (i.e. get 1.500 as my output instead)?

The third and fourth arguments of number_format control the characters used for the decimal point and the thousands separator, respectively. So you can just do this:

number_format(
    1500,
    0, // number of decimal places
    ',', // character to use as decimal point
    '.' // character to use as thousands separator
)

and get "1.500" as your result.