 Hey everybody, this is Brian. Welcome to the 17th lamp tutorial. Today we're going to be discussing associative arrays. What is an associative array? Well, we already know an array is a variable that has multiple values in it. You get those values through an index. Well, an associative array is when you associate an index with a value. In other words, you're making a label and a value. You see here we have the ages variable. We're making an array, but instead of just giving it numbers, we're saying label is Peter, the value is 32. Notice that special combination of characters right there equal greater sign. You would access those by saying the variable name and then the index, in this case Peter, I should say the label and then the value. So let's go ahead and jump in here and write some code. Let's say you want to make a list of everyone's favorite colors. So we're going to say colors equal gray, Brian, my favorite color is blue. Just in case you were ever wondering that, Heather, my daughter, let's say her favorite color is of course black. All teenage girls seem to love black and then Florence, my grandmother. Let's say her favorite color is of course all grandmas love pink. So there we have our associative array. Now we want to actually extract information out of this. So let's say echo, I hope if I could type. Heather's fave color is, now instead of using an index like this, well you could do that. You see how colors one, you got to know the position. We're going to actually use the label, in this case Heather, colors black. Now notice how when we actually, let's rewind here just a minute. I want to make an important point and let's add some HTML goodness here so we can actually see what we're doing. I'm kind of keeping an eye out in the corner here. My cats were fighting over the catnip I used to bribe them. Alright, so what is going on here? So it says black, Heather's favorite color is black. Well let's actually admit this. Where is the value? Notice how it says colors one, just because there's no label with one. Now let's actually get rid of this and see what happens. Nothing, there's just nothing there. Why? Because there's no label. That's how you work with an associative array. You have to work with labels. See? Colors Heather. Her color is black. Heather's fave color is black. So you could instantly change this. Let's say Florence. Florence's fave color is pink. See how you're accessing the array based off the label rather than the position? That's an associative array. Pretty easy to understand once you know how to work with it, but sometimes it's just hard to really grasp the concept until you see it in action. Well that's all for this tutorial. This is Brian. Thank you for watching.