From the course: PHP Essential Training

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Associative arrays

Associative arrays - PHP Tutorial

From the course: PHP Essential Training

Associative arrays

- PHP has another type of array called an Associative Array. And it's important for us to learn how to use both types, and to understand the difference between them. An Associative Array is an object indexed collection of objects. Now, it's very similar to what we saw for the definition of a regular array but notice that it doesn't say that it's ordered anymore. And instead of being integer indexed, it is object indexed. That is they're going to be indexed by a label of some sort, let's remember the expanding file folder metaphor that I gave you when we were talking about a arrays Associative Arrays are similar, but they work more like hanging file folders. They're not in any certain order and they can be rearranged. Each of those file folders is going to have a label on it. And that's how we're going to find information. Since we won't know what order the information is in. Instead we will thumb through those file folders…

Contents