WordPress 常用函数 / zeroise
添加必要的前导零。
如果 $threshold 设置为'4',并且 $number 是是'10',返回'0010',如果 $number 是'5000',返回'5000'。
主要使用 sprintf 根据 $threshold 参数和数字本身的长度来填充前导零,如果数字本身够长,就不会有零添加。
<?php zeroise( $number, $threshold ); ?>
<?php zeroise( $number, $threshold ); ?>$number
(mixed) (required) 要添加前导零的数字。
Default: None
$threshold
(integer) (required) 添加前导零之后的数字的长度。
Default: None
(string)
添加前导零之后的数字。
详细介绍:给留言序号添加前导零
Since: 0.71
wp-includes/formatting.php