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.




Related Posts:

  • PHP data types PHP data types   Data types specify the size and type of values that can be stored. —Variable does not need to be declared ITS DATA… Read More
  • PHP echo & Print, PHP Comments Difference between echo and print in PHP   —PHP echo and print both are PHP Statement.    Both are used to d… Read More
  • PHP CONSTANTS Constant in PHP —Constants are PHP container that remain constant and never change —Constants are used for data that is unchanged at mult… Read More
  • Magic Constants Figure 1 1 .__LINE__         The current line number of the file.               &… Read More
  • $var & $$var and php super global variables Difference Between $var and $$var in Php —$$var uses the value of the variable whose name is the value of $var. —It means $$var is known … Read More