/ Published in: PHP
Expand |
Embed | Plain Text
/** * Ridefinisce la chiave di un array con uno degli elementi a scelta * @param $x * @param $key_value * @return array */ function reindex($x, $key_value) { foreach($x as $_ => $v) { $ret[$v["$key_value"]] = $v; } return $ret; }
Comments
Subscribe to comments
You need to login to post a comment.

Redefine the key of an array with one of the elements you choose.