• 实例首页
  • 自学教程
  • IT工具箱
xxxxxxxxxx
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<title>PHP $GLOBALS 实例 - 自学教程(runoops.com)</title>
6
</head>
7
<body>
8
​
9
<?php 
10
$x = 75; 
11
$y = 25;
12
 
13
function addition() 
14
{ 
15
    $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y']; 
16
}
17
 
18
addition(); 
19
echo $z; //输出:100
20
?>
21
​
22
</body>
23
​
24
</html>

© 2023 自学教程   runoops.com All Rights Reserved. 备案号:闽ICP备19010956号-1