• 实例首页
  • 自学教程
  • IT工具箱
xxxxxxxxxx
 
1
<!DOCTYPE html>
2
<html>
3
​
4
<head>
5
    <meta charset="utf-8">
6
    <title>PHP array() 遍历数组 实例 - 自学教程(runoops.com)</title>
7
</head>
8
​
9
<body>
10
​
11
    <?php
12
    $cars = ["Volvo", "BMW", "Toyota"];
13
    $arrlength = count($cars);
14
    for ($x = 0; $x < $arrlength; $x++) {
15
        echo $cars[$x];
16
        echo "<br>";
17
    }
18
    ?>
19
​
20
</body>
21
​
22
</html>