Example

Actual PHP Output

Bobby, Tom, Troy, Matthew, Peter, John

The above array originally has 8 elements, representing 8 names of students.

Here we only specify the $array and the $index. Since we specify an index of 2, we cut off all elements before index 2. Thus, 'Greg' and 'Lisa' are cut off, since they are before
index 2. We start at the name 'Bobby'. Since we don't specify the length of elements we want, we keeps all elements to the end of the array.

Now let's take the same array as above and slice not to the end but up until Matthew, which is index
element 5. The PHP Code to do this would be: