Answers for "if number is positive php"

PHP
1

php if negative make positive

<?php
echo(abs(6.7) . "<br>");
echo(abs(-6.7) . "<br>");
echo(abs(-3) . "<br>");
echo(abs(3));
?>
Posted by: Guest on November-18-2020
0

php check if input is a positive integer

$filter_options = array( 
    'options' => array( 'min_range' => 0) 
);


if( filter_var( $i, FILTER_VALIDATE_INT, $filter_options ) !== FALSE) {
   ...
}
Posted by: Guest on June-05-2021

Browse Popular Code Answers by Language