Re: array_map() function modification

From: Date: Sat, 12 Jan 2013 17:46:34 +0000
Subject: Re: array_map() function modification
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-64900@lists.php.net to get a copy of this message
On 12.01.2013, at 21:34, Thomas Hruska <thruska@cubiclesoft.com> wrote: > This would allow developers to do things like: > > $keys = array('key1', 'key2', ..., 'keyn'); > $vals = array('val1', 'val2', ..., 'valn'); > > $somemap = array_map($keys, $vals); > > Which would result in $somemap containing: > > array('key1' => 'val1', 'key2' => 'val2', ..., > 'keyn' => 'valn') There is a function for this: http://docs.php.net/array_combine -- Alexey Zakhlestin https://github.com/indeyets

« previous php.internals (#64900) next »