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

  1. if ( !function_exists( 'absint' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4. // Data you wish to have converted to a non-negative integer. 
  5. $maybeint = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = absint($maybeint); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.php  
  1. function absint( $maybeint ) { 
  2. return abs( intval( $maybeint ) );