absint()
absint( mixed $maybeint ) 将值转换为非负整数。 Convert a value to…
absint( mixed $maybeint )
将值转换为非负整数。
Convert a value to non-negative integer.
目录锚点:#参数#源码#笔记
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $maybeint | (mixed) | 希望转换为非负整数的数据。 |
源码(Source)
/**
* Convert a value to non-negative integer.
*
* @since 2.5.0
*
* @param mixed $maybeint Data you wish to have converted to a non-negative integer.
* @return int A non-negative integer.
*/
function absint( $maybeint ) {
return abs( intval( $maybeint ) );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.5.0 | wp-includes/functions.php | 17 | 19 |
笔记(Notes)
当传递一个负整数时,您将得到非负的绝对值。传递非int字符串返回0,但传递-10返回10:
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!