Possible Duplicate:
Using global vars within a function in PHP the way you do it in Javascript
For some reason, the following program is giving me an error:
<?php
$a = 1;
function func() {
echo $a;
}
func();
?>
That is the entire program. The error is:
Notice: Undefined variable: a in what.php on line 5
Am I misunderstanding something fundamental?