W3cubDocs

/WordPress

absint( mixed $maybeint ): int

Converts a value to non-negative integer.

Parameters

$maybeintmixedrequired
Data you wish to have converted to a non-negative integer.

Return

int A non-negative integer.

Source

function absint( $maybeint ) {
	return abs( (int) $maybeint );
}

Changelog

Version Description
2.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/absint