Indexed Arrays5:13 with Alena Holligan
An array is a compound variable type meaning it can contain more than one value. We'll start with a basic indexed array, which can be used as a list of items: shopping list, days of the week, the top ten scores in a game, or a todo list.
Arrays in PHP are actually ordered maps. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays, trees and multidimensional arrays are also possible.
See more about the Function for Creating Arrays
Shortcut for Assigning Values
Leave off the array keyword and use square brackets instead.
$learn = ['Conditionals', 'Arrays', 'Loops'];
You need to sign up for Treehouse in order to download course files.Sign up