# Help - Associative Array Woes

**URL:** https://forum.kirupa.com/t/help-associative-array-woes/230496
**Category:** programming
**Created:** [June 26, 2007, 6:52pm UTC](https://forum.kirupa.com/t/help-associative-array-woes/230496 "2007-06-26T18:52:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mar1b0r0man](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@mar1b0r0man](https://forum.kirupa.com/u/mar1b0r0man)
#### Post date: [June 26, 2007, 6:52pm UTC](https://forum.kirupa.com/t/help-associative-array-woes/230496/1 "2007-06-26T18:52:05Z")

</div>

Hi all,

I’m a newbie to PHP and need some help. I want to grab values from 2 arrays to create a new associative array. Not sure how I should loop through this, can someone please help? Any suggestions or recommendations would be greatly appreciated, thanks =)

$ar1 = array(‘a’, ‘b’, ‘c’);  
$ar2 = array(1, 2, 3);

$ar3 = array();

I want $ar3 to look like this:

$ar3 = array (  
‘a’ =\> 1,  
‘b’ =\> 2,  
‘c’ =\> 3,  
);
