代码如下:

$tools = ['c' => 'Visual C', 'java' => 'eclipse', 'php' => 'nodepad'];

foreach ($tools as $key => $value) {
    echo 'the ' . $value . ' is the tool of ' . $key . '\n';
}

输出结果如下:

the Visual C is the tool of c
the eclipse is the tool of java
the nodepad is the tool of php
PHP 数组遍历:使用 foreach 输出工具信息