今天要批量生成一批合同号,遇到问题了,比如说
start=0066812~end=0066818
for ($start;$start 除了0066812之外,后面的全将00给去掉了,请问有什么方法可以保留住0的??
$start = 66812;$end = 66818;for ($start;$start<=$end;$start++){ $s = sprintf('%07d', $start); echo $s . '<br>';}
0066812006681300668140066815006681600668170066818
$start = 66812;$end = 66818;for ($start;$start<=$end;$start++){ $s = sprintf('%07d', $start); echo $s . '<br>';}
0066812006681300668140066815006681600668170066818
有什么区别吗?
$start = '0066812';$end = '0066818'; for ($start;$start<=$end;$start++){ $s = sprintf('%07d', $start); echo $s . '<br>';}
有什么区别吗?
$start = '0066812';$end = '0066818'; for ($start;$start<=$end;$start++){ $s = sprintf('%07d', $start); echo $s . '<br>';}