Answers for "check number is positive or negative in 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
1

check number is positive or negative in php

if($number > 0){
  echo "the number is positive";
}
elseif($number < 0){
  echo "the number is negative";
}
else{
  echo "the number is zero";
}
Posted by: Guest on June-29-2020

Code answers related to "check number is positive or negative in php"

Browse Popular Code Answers by Language