php check if input is a positive integer

Solutions on MaxInterview for php check if input is a positive integer by the best coders in the world

showing results for - "php check if input is a positive integer"
Jonathan
30 Jan 2019
1$filter_options = array( 
2    'options' => array( 'min_range' => 0) 
3);
4
5
6if( filter_var( $i, FILTER_VALIDATE_INT, $filter_options ) !== FALSE) {
7   ...
8}
9