如何在php中将数字格式化为十进制

I have the below simple number, $total = 1060;, that i need to format as below using PHP

10.60

What i tried

$total = 1060;
number_format($total, 2)

But the result showing is 1,060.00 instead of the below 10.60

Plus I need it to be a dot . and not a comma , as the separator

All you need to do is divide by 100 in before you format it. That makes it 10.6 (because the second decimal is zero, it's not needed and stripped away), and then you format it to have two decimal places.

$total = 1060;
number_format($total/100, 2); // 10.60