<?php
//声明全局变量的时候不能赋值,就是声明变量和赋值分两步骤
//global $a=110;
global $a;
$a=110;
function test()
{
//方法内要使用全部变量要再次声明
global $a;
$a++;
echo $a."<br/>";
}
test();
test();
test();
test();
?>
<?php
//声明全局变量的时候不能赋值,就是声明变量和赋值分两步骤
//global $a=110;
global $a;
$a=110;
function test()
{
//方法内要使用全部变量要再次声明
global $a;
$a++;
echo $a."<br/>";
}
test();
test();
test();
test();
?>