<html>
<! Function3.php                                              >
<! Chapter 7, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates defining a function without       >
<! formal parameters that accesses a user-defined global      >
<! variable and create a local scope vairable inside a        >
<! function.                                                  >
<head>
<title>
  Chapter 7 : Function3.php
</title>
</head>
<body>
<?php
  // Declare a user-defined global variable.
  define('LOCAL',"[The global variable]");

  // Call function.
  print_string();

  // Print function declared local variable.
  print $function_local;

  // Define a function.
  function print_string()
  {
    // Define a global scoped variable.
    GLOBAL $function_local;

    // Print the local variable with a text literal.
    $function_local = LOCAL." is inside the function.";
  }
?>
</body>
</html>
