Create a variable and use in computation in PHP

Description

The following code shows how to create a variable and use in computation.

Example


<?php/*  www. j  av a2 s .c  o m*/
  //create variable
  $result = 2 + 5;

  //create another variable
  $doubleResult = $result * 2.001;

  //print the second variable
  print($doubleResult);
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Language Basic »




PHP Introduction
PHP Operators
PHP Statements
Variable
PHP Function Create
Exception
PHP Class Definition