Tribe__Validator__Base::is_positive_int_list( array|string|int $list, string $sep = ',' )
Whether the value is a list of positive integers only or not.
Contents
Parameters
- $list
-
(array|string|int) (Required)
- $sep
-
(string) (Optional)
Default value: ','
Return
(bool)
Source
File: src/Tribe/Validator/Base.php
public function is_positive_int_list( $list, $sep = ',' ) {
$sep = is_string( $sep ) ? $sep : ',';
$list = Tribe__Utils__Array::list_to_array( $list, $sep );
$valid = array_filter( $list, array( $this, 'is_positive_int' ) );
return ! empty( $valid ) && count( $valid ) === count( $list );
}
Changelog
| Version | Description |
|---|---|
| 4.7.19 | Introduced. |