What's the most straightforward way in PHP to create an associative array from two parallel indexed
Posted
by pjbeardsley
on Stack Overflow
See other posts from Stack Overflow
or by pjbeardsley
Published on 2010-06-08T18:51:29Z
Indexed on
2010/06/08
19:02 UTC
Read the original article
Hit count: 167
Given the following two indexed arrays:
$a = array('a', 'b', 'c');
$b = array('red', 'blue', 'green');
What is the most straighforward/efficient way to produce the following associative array?:
$result_i_want = array('a' => 'red', 'b' => 'blue', 'c' => 'green');
Thanks.
© Stack Overflow or respective owner