php ajax 求一个简单例子 ajax php
更新时间:2022-01-20 10:35:43 • 作者:EDITH •阅读 9896
一段简单的PHP代码
经运行检测,代码没有问题:
<?php
$sum = 0;
for ($i = 1; $i <= 50; $i++) {
$sum += $i;
echo "$i = $sum <br />";
}
?>
1 = 1
2 = 3
3 = 6
4 = 10
5 = 15
6 = 21
7 = 28
8 = 36
9 = 45
10 = 55
11 = 66
12 = 78
13 = 91
14 = 105
15 = 120
16 = 136
17 = 153
18 = 171
19 = 190
20 = 210
21 = 231
22 = 253
23 = 276
24 = 300
25 = 325
26 = 351
27 = 378
28 = 406
29 = 435
30 = 465
31 = 496
32 = 528
33 = 561
34 = 595
35 = 630
36 = 666
37 = 703
38 = 741
39 = 780
40 = 820
41 = 861
42 = 903
43 = 946
44 = 990
45 = 1035
46 = 1081
47 = 1128
48 = 1176
49 = 1225
50 = 1275
PHP如何利用函数来包含文件
<?php include("1.php") ?> 包含文件,将参数放至session上,在1.php页面获取session进行操作。