absint
Convert a value to non-negative integer.
Description
(int) absint( (mixed) $maybeint );
Returns (int)
A non-negative integer.
Parameters (1)
- 0. $maybeint (mixed)
- Data you wish to have converted to a non-negative integer.
Usage
if ( !function_exists( 'absint' ) ) { require_once ABSPATH . WPINC . '/functions.php'; } // Data you wish to have converted to a non-negative integer. $maybeint = null; // NOTICE! Understand what this does before running. $result = absint($maybeint);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/functions.php
- function absint( $maybeint ) {
- return abs( intval( $maybeint ) );
- }