How to Find Absolute Value of a Number - Php

Find Absolute Value

Snippet Code


  
Rate this page :
  [ 0 votes]

Absolute number or modulus |x| is a way to express any non-negative real number x without considering its negative sign.

<?php $number='-5.15'; echo abs($number); echo '<br>'; $number1='10.7'; echo abs($number1); echo '<br>'; $number2='10'; echo abs($number2); echo '<br>'; $number3='-7'; echo abs($number3); ?>

Tags


Ask Questions

Ask Question