1.输出数字为001,002...
<?php
$number=0;
if($number<100)
{
$number=$number+1;
$txt=sprintf("%03d",$number);//生成3位数,不足前面补0
echo $txt;
}
?>
2023-08-20 11:23:34
1.输出数字为001,002...
<?php
$number=0;
if($number<100)
{
$number=$number+1;
$txt=sprintf("%03d",$number);//生成3位数,不足前面补0
echo $txt;
}
?>
下一篇:js 数字前面自动补零