\n";
echo "Outside of a used defined function, php variable1 = $variable1
\n";
echo "Outside of a used defined function, php variable2 = $GLOBALS[variable2]
\n";
echo "Outside of a used defined function, php variable3 = $variable3
\n";
echo "Outside of a used defined function, php variable4 = $variable4
\n";
echo "Outside of a used defined function, php variable5 = $variable5
\n";
echo "
\n";
function demo8_function2() {
global $variable3; // DECLARE $variable3 as globally available
global $variable4; // DECLARE $variable4 as globally available
global $variable5; // DECLARE $variable5 as globally available
echo "Inside of the user defined function, php variable1 = $variable1
\n";
echo "Inside of the user defined function, php variable2 = $GLOBALS[variable2], since it is in the \$GLOBALS array.
\n";
echo "Inside of the user defined function, php variable3 = $variable3, but only if defined as global
\n";
echo "Inside of the user defined function, php variable4 = $variable4
\n";
echo "Inside of the user defined function, php variable5 = $variable5, but only if defined as global here and in demo8_function1()
\n";
echo "
\n";
}
?>