Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php number positive

<?php
echo abs(-4.2); // 4.2 (double/nombre à virgule flottante)
echo abs(5);    // 5 (entier)
echo abs(-5);   // 5 (entier)
?>
Comment

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";
}
Comment

PREVIOUS NEXT
Code Example
Php :: get post by taxonomy 
Php :: how to validate use unique in laravel 8 controller 
Php :: php array_reverse keep keys 
Php :: php find substring 
Php :: sql repare php 
Php :: php session get data 
Php :: strtotime add 1 hour 
Php :: sanitize user input php 
Php :: Invalid request (Unsupported SSL request) 
Php :: php clean all output buffers 
Php :: php mess detector 
Php :: php permanent redirect to url 
Php :: rearrange array index php 
Php :: acf gallery 
Php :: php write to file 
Php :: php contains substring 
Php :: aws s3 laravel package 
Php :: sanitize_text_field 
Php :: Fatal error: Cannot redeclare 
Php :: php slugify 
Php :: remove array element php 
Php :: laravel old request radio check 
Php :: how to format php document in vs code 
Php :: php array longest string 
Php :: run a server php terminal 
Php :: wordpress require file from plugins folder 
Php :: carbon difference between two dates 
Php :: pass parameter to view laravel 
Php :: datetime php 
Php :: php find part of string in array 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =