Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

map associative array php0

$array = [
  'category1' => 'first category',
  'category2' => 'second category',
];
 
$new = array_map(function($key, $value) {
  return "{$key} => {$value}";
}, array_keys($array), $array);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #map #associative #array
ADD COMMENT
Topic
Name
5+6 =