Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Indexed Arrays 5:13
- Adding Array Elements 5:08
- List Quiz 5 questions
- Removing Array Elements 4:50
- Editing Array Elements 1:36
- Modifying Arrays 3 objectives
- Associative Arrays 3:48
- Associative Quiz 5 questions
- Mixing Data Types in Arrays 6:07
- Multidimensional Arrays 6:14
- Multidimensional Arrays 3 objectives
- Sorting Arrays 6:16
- Mixing and Sorting 5 questions
Well done!
You have completed PHP Arrays and Control Structures!

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Multidimensional arrays allow me to create an nested array of information for each item in my list. In this video we'll take a look at the format for creating multidimensional arrays.
In a multidimensional array, a key in the outer array contains a secondary inner array. Multidimensional arrays may have indexed or named keys.
Example
$task1 = array(
'title' => 'Laundry',
'priority' => 2,
'due' => '',
'complete' => true,
);
$taskList = array($task1);
$taskNames['Task 1'] = $task1;
In the code above $taskList[0]['title'], $taskNames['Task 1']['title'] and $task1['title'] all return 'Laundry'.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
anthonybrackner
17,776 Points2 Answers
-
A X
12,842 Points4 Answers
-
Santis Smagars
980 Points6 Answers
-
abcd efgh
824 Points1 Answer
-
Hazem mosaad
15,384 Points7 Answers
-
Thad Roe
10,687 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up