<html>
<! Function4.php                                              >
<! Chapter 7, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates how to define a no parameter      >
<! function that shows scope control. Functions can only      >
<! access variables that meet certain conditions. They can be >
<! globally or script level variables, which are universally  >
<! in scope; or they must be passed by value or reference     >
<! into the function. Local variables in a given script can   >
<! not be referenced inside a function like many other        >
<! programming languages.                                     >
<head>
<title>
  Chapter 7 : Function4.php
</title>
</head>
<body>
<?php
  // Declare a variable.
  $local_var = "Local variable";

  // Define a function that prints a string.
  function print_string()
  {
    // Print the local variable with a text literal.
    print "[".$local_var."]";
  }

  // Print string.
  print_string();
?>
</body>
</html>
