# \[AS 2.0\] Associative Arrays?

**URL:** <https://forum.kirupa.com/t/as-2-0-associative-arrays/218092>\
**Category:** flash\
**Created:** [March 5, 2007, 1:00am UTC](https://forum.kirupa.com/t/as-2-0-associative-arrays/218092 "2007-03-05T01:00:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeletedUser12345](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@DeletedUser12345](https://forum.kirupa.com/u/DeletedUser12345)\
**Post date:** [March 5, 2007, 1:00am UTC](https://forum.kirupa.com/t/as-2-0-associative-arrays/218092/1 "2007-03-05T01:00:18Z")

</div>

Hey all,

I’m creating a “Tea/Benefits Chart” that allows the user to search for a type of tea and find out what problems it can cure, or search for a problem and find out what types of tea assist with it. For this I’ve created 2 arrays - arrTea and arrBenefits - to store a list of the possible types of tea and benefits a user can find.

Code:

```php

var arrTea:Array = Array("lemongrass", "chamomile");
var arrBenefits:Array = Array("anxiety", "cramps", "indigestion", "PMS");

```

For example, if the user searched for “chamomile” the Chart might return “anxiety” and “indigestion”. If they searched for “cramps” the Chart returns “lemongrass”.

I need a way to keep track of which teas go with which benefits and vice versa. Would this be a situation to use associative arrays? I’d appreciate any guidance on this.

Thanks a lot!
