<?php $a = 3; function fun() { global $a; echo $a; } fun();?> 在函数体内定义的global变量,函数体外可以使用,在函数体外定义的global变量不能在函数体内使用,