llms_rest_validate_positive_int( integer $number, boolean $include_zero = true )
Validate positive integer number
Parameters Parameters
- $number
-
(integer) (Required) Integer number to validate.
- $include_zero
-
(boolean) (Optional) Whether or not 0 is included. Default is
true
.Default value: true
Return Return
(boolean)
Source Source
File: libraries/lifterlms-rest/includes/server/llms-rest-server-functions.php
function llms_rest_validate_positive_int( $number, $include_zero = true ) { return false !== filter_var( $number, FILTER_VALIDATE_INT, array( 'options' => array( 'min_range' => $include_zero ? 0 : 1, ), ) ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.18 | Introduced. |