Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

array reduce associative array php

$assoc_arr = array_reduce($arr, function ($result, $item) {
    $result[$item['text']] = $item['id'];
    return $result;
}, array());
Source by www.danielauener.com #
 
PREVIOUS NEXT
Tagged: #array #reduce #associative #array #php
ADD COMMENT
Topic
Name
1+6 =