Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
先頭の 0 を最大 9 まで埋めてから削除しようとしています。
01、02、03、04、05、06、07、08、09 - 10、11、12、14
これまでのところ、私はこれを持っています:
<?php $value = $count++; printf("%02d", $value); ?>
使用することもできますstr_pad()
str_pad()
<?php $value = $count++; echo str_pad($value, 2, "0", STR_PAD_LEFT); ?>