llms_rest_validate_positive_int( integer $number, boolean $include_zero = true )

Validate positive integer number

Parameters Parameters


(integer) (Required) Integer number to validate.


(boolean) (Optional) Whether or not 0 is included. Default is true.

Default value: true

Top ↑

Return Return


Top ↑

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(
			'options' => array(
				'min_range' => $include_zero ? 0 : 1,

Top ↑

Changelog Changelog

Version Description
1.0.0-beta.18 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.