我这这样的一组ID字符串
10
1010
10122233我想转换成 下面的整型数10 000 000 000
10 100 000 000
10 122 233 000
请问一下,这样的算法,我怎么写一下。
最好是有一个方法。
10
1010
10122233我想转换成 下面的整型数10 000 000 000
10 100 000 000
10 122 233 000
请问一下,这样的算法,我怎么写一下。
最好是有一个方法。
$s = str_pad($s, 11, '0');
$t = number_format($s);
echo join(' ', explode(',', $t));
$str1='10';
$str2='1010';
$str3='10122233';
//10 000 000 000
//10 100 000 000
//10 122 233 000
echo str_pad($str1, 11,'0').'<Br>';
echo str_pad($str2, 11,'0').'<br>';
echo str_pad($str3, 11,'0').'<Br>';