在php中生成整数值

Ram*_*esh -1 php

我需要将字符串转换为以下格式.

1000 -> 0000001000
10000 -> 0000010000
25000 -> 0000025000
Run Code Online (Sandbox Code Playgroud)

我试过这种方式 ceil(str_pad($range_array[0],6 , "0", STR_PAD_LEFT))

但这适用于1000,但失败了10,000.

有没有创建它的功能?

Sea*_*ght 9

echo sprintf("%010d", $number);
Run Code Online (Sandbox Code Playgroud)