PHP: Testing Variable Scope

Start PHP Code RESULT
Test variable:
$testvariable does not print: request outside function scope

End PHP Code RESULT

 

The PHP Code START
<?php
function test() {
    $testvariable = "This is a test variable";
}

print "Test variable: $testvariable<br />";
print "\$testvariable does not print: request outside function scope<br />";
?>
The PHP Code END

Back to Bill's PHP