📜  php 全局变量函数 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:08.625000             🧑  作者: Mango

代码示例2
$a = 1;
$b = 2;
function Sum(){
    global $a, $b; // allows access to vars outside of function
    $b = $a + $b;
} 

Sum();
echo $b; // output is 3