function a call first after call call function b. if you pass parameter in function b or set as globel $a in function a
set as globel $a in function a() because this variable use in finction b without passing parameter and set globel $a in function b because not define this variable this function
<?php
function a(){
global $a;
$a = "hello";
function b(){
global $a;
echo $a . " World";
}
b();
}
a();
?>
or you can use
<?php
function a(){
$a = "hello";
function b($a){
echo $a . " World";
}
b($a);
}
a();
?>