Variable Scope: A Variable Declared Within a Function Is Unavailable Outside the Function : Variable Scope « Language Basics « PHP
- PHP
- Language Basics
- Variable Scope
Variable Scope: A Variable Declared Within a Function Is Unavailable Outside the Function
<html>
<head>
<title>Local Variable Unavailable Outside a Function</title>
</head>
<body>
<div>
<?php
function test() {
$testvariable = "this is a test variable";
}
print "test variable: $testvariable<br/>";
?>
</div>
</body>
</html>
Related examples in the same category