Merge two arrays as key value pairs in PHP -


i've got 2 arrays of same size. i'd merge 2 values of 1 key indexes of new array, , values of new array values of other.

right i'm looping through arrays , creating new array manually, have feeling there more elegant way go this. don't see array functions purpose, maybe missed something? there simple way along these lines?

$mapped_array = mapkeys($array_with_keys, $array_with_values); 

see array_combine() on php.net.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -