Editing Array Elements1:36 with Alena Holligan
Have you ever misspelled a word? Or maybe changed your mind about something? Programming is no different, and sometimes we'll need to edit an array element. In this video we'll see how to modify an element by specifying it's key.
Additional Option for Modifying an Array
There are many Array Functions for modifying arrays. A few to get you started:
array_splice: remove a portion of the array and replace it with something else.
array_combine: creates an array by using one array for keys and another for its values.
array_merge: merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one. It returns the resulting array.
You need to sign up for Treehouse in order to download course files.Sign up