PHP函数内访问全局变量时间:2023-03-10 04:34:39 $dbcon='123'; 方法一、funtion fun1(){global $dbcon;$dbcon-> 就可以访问了。} 方法二$GLOBALS['$dbcon'];