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
I don't know about you, but I'm constantly adding things to my todo list. In this video we'll look at three ways php gives us to add elements to an array -- two of which let you add elements to the end of the array, and one which lets you add elements to the beginning of the array.
Documentation
- Arrays: add a new element to the end of an array, $array[] = 'New Element Value';
- array_push: push one or more elements onto the end of array.
- array_unshift: prepend one or more elements to the beginning of an array
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
PLUS
kevin hudson
Courses Plus Student 11,987 Points0 Answers
-
Jin Jie Seah
2,492 PointsHow to run console without typing the file name again and again
Posted by Jin Jie SeahJin Jie Seah
2,492 Points4 Answers
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