可以使用 foreach 循环遍历数组,并使用字符串拼接输出每个值:

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

输出结果为:

The Visual C is the tool of c.
The exlipse is the tool of java.
The nodepad is the tool of php.
PHP 使用 foreach 循环遍历数组并输出特定格式