📜  映射关联数组 php0 - PHP 代码示例

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

代码示例1
$array = [
  'category1' => 'first category',
  'category2' => 'second category',
];
 
$new = array_map(function($key, $value) {
  return "{$key} => {$value}";
}, array_keys($array), $array);