A WordPress-centric search engine for devs and theme authors



rest_is_integer ›

Since5.5.0
Deprecatedn/a
rest_is_integer ( $maybe_integer )
Parameters:
  • (mixed) $maybe_integer The value being evaluated.
    Required: Yes
Returns:
  • (bool) True if an integer, otherwise false.
Defined at:
Codex:

Determines if a given value is integer-like.



Source

function rest_is_integer( $maybe_integer ) {
	return round( floatval( $maybe_integer ) ) === floatval( $maybe_integer );
}