Local Variable
A local variable is accessible only the block where it has defined. When a code block over then the entire local variable inside of block automatically released by the compiler.
<?php
function fun1()
{
$a=10;
echo $a;
}
function fun2()
{
echo
$a+10;
// Error :
Undefined variable: a because it has not defined in fun2 and a is local
variable for fun1
}
?>
<?php
//fun1();
fun2();
?>