<html>
<! VariableVariables.php                                      >
<! Chapter 4, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates how the variable variables work   >
<! in PHP.                                                    >
<head>
<title>
  Chapter 4 : VariableVariables.php
</title>
<style>
.normal {font-family:Courier;font-style:normal;font-weight:normal;
         font-size:12pt;color:#000000;background-color:#ffffff};
</style>
</head>
<body>
<?php
  // Declare variables by assigning a value.
  $myVar = "varName";

  // Declare a variable variable by assigning the value $myVar
  // as the name of variable in a variable.
  $$myVar = "Variable Value";

  // Print the variable names and contents.
  print "\$myVar [" . $myVar . "]<br>";

  // Print the variable variable by using two $ reference.
  print "\${\$myVar} [" . ${$myVar} . "]<br>";

  // Print the base variable name and the variable in a variable.
  print "\$varName [" . $varName . "]<br>";
?>
</body>
</html>
