How would I trim a number to 5 digits in PHP?
I have a number like this:
12345678987654321
I want to only use the first 5 digits like this:
123开发者_JS百科45
How would I do that in PHP? number_format
?
Something like substr($number, 0, 5);
would suffice.
$num = "12345678987654321";
$num2 = substr($num, 0, 5);
精彩评论