📜  php foreach 关联数组 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:55.375000             🧑  作者: Mango

代码示例1
$arr = array(
  'key1' => 'val1',
  'key2' => 'val2',
  'key3' => 'val3'
);

foreach ($arr as $key => $val) {
  echo "$key => $val" . PHP_EOL;
}