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


Top ↑

Return Return

(boolean)


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


Top ↑

Changelog 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.