Friday 11 December 2015

PHP Numeric

ceil
<?php      
  $num=19.7
  echo ceil($num);
?>
In the above example,
Initialize variable $num with value=19.7 , output will become 20.
because this function round value up.
floor
 <?php   
  $num=19.7  
  echo floor($num);
?>
In the above example
variable $num = 19.7,and the output will become 19.
Because this function round value down.
 pow
<?php      
  echo pow(4,3);
?>
In the above example.
Pass  pow( ) function inside echo with value(4,3).
Its multiply (value=4). three times and the result is 64.

rand
 <?php   
  echo rand(10,99);
?>
In the above example
Pass rand( ) function With value from( 10 to 99 ).
it will display any random value lies from 10 to 100.
when we refresh the page on every refresh it show random value like. 22,33 ,44,56 and so on.