Adding Two Number in php

Adding two numbers in php is a very simple task like you have done in other languages. You need to declare three variables or you can initialize them by assign value. like given below:
PHP Code:
  1. <?php
  2. //First variable initialization
  3. $FirstNumber = 10;
  4.  
  5. //second variable initialization
  6.  $SecondNumber = 20;
  7.  
  8. //Third variable initialization with add operation 
  9.  
  10. $Sum = $FirstNumber + $SecondNumber;
  11.  
  12. //printing the result that should be 30
  13.  
  14. echo "Sum of Two number is :".$Sum;
  15.  
  16. ?>
Now save this file with index.php inside your server's root directory. and open browser to see the result. 

intphp.blogspot.com