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); ?>