常用函数-zeroise()

0条评论

常用函数-zeroise()

说明

必要时添加前导符零。

如果将阈值设为'4',数字为'10',将返回'0010'。如果将阈值设为'4',数字为'5000',返回'5000'。

该函数在$threshold参数以及数字大小的基础上用sprintf来添加零的个数。数字足够大时无需添加零。

用法

<?php zeroise( $number, $threshold ) ?>

参数

$number

(混合)(必须)数字小于等于阈值时应添加的零的个数

默认值:None

$threshold

(整数)(必须)阈值后无需加零

默认值:None

返回的值

(字符串)

必要时在数字后添加前导零。

示例

注释

修改记录

自0.71版本后

源文件

zeroise()位于 wp-includes/feed.php.中。

相关资源

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.