Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Build a Basic PHP Website!
You have completed Build a Basic PHP Website!
Preview
We will use a multidimensional associative array to store the information for our Media Library Catalog. In this video, we’ll add a second dimension to our current array.
DOWNLOAD
Catalog data.txt
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
the catalog.php file, we had our catalog
stored in a simple indexed array.
0:00
Instead of letting PHP assign the key,
0:01
we have specified our own item ID for
the key.
0:03
Each element in the main catalog
array represents one item.
0:07
Right now each element has a piece of text
with a title of the item as its value.
0:11
Let's change this first element
making the value another array
0:16
instead of just a piece of text.
0:21
Let's go back into our catalog.
0:23
Before we add any more
information to our array here,
0:26
let's separate out this code
into a new include file.
0:29
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