<html>
<! VariableAssignment2.php                                    >
<! Chapter 4, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates variable assignments and scope    >
<! for operation assignment operators.                        >
<head>
<title>
  Chapter 4 : VariableAssignment2.php
</title>
</head>
<body>
<?php
  // Declare variables by assigning a value.
  $myVar1 = 1;
  $myVar2 = 1;
  $myVar3 = 1;
  $myVar4 = 1;
  $myVar5 = 1;
  $myVar6 = 1;
  $myVar7 = 1;

  // Print result of addition assignment operator.
  print "\$myVar1 [".($myVar1 += 10)."] [".gettype($myVar1)."]<br>";

  // Print result of subtraction assignment operator.
  print "\$myVar2 [".($myVar2 -= 10.1)."] [".gettype($myVar2)."]<br>";

  // Print result of concatenation assignment operator.
  print "\$myVar3 [".($myVar3 .= 10)."] [".gettype($myVar3)."]<br>";

  // Print result of pre-increment/pre-decrement operator.
  print "\$myVar4 [".(++$myVar4)."] [".gettype($myVar4)."]<br>";
  print "\$myVar6 [".(--$myVar5)."] [".gettype($myVar6)."]<br>";

  // Print result of post increment/decrement operator.
  print "\$myVar5 [".($myVar6++)."] [".gettype($myVar5)."]<br>";
  print "\$myVar7 [".($myVar7--)."] [".gettype($myVar7)."]<br><p>";
?>
</body>
</html>
