How this arrays (indexed) example works
Indexed arrays use integer keys starting at 0. $array[] = $value appends, array_unshift() prepends, array_pop() removes the last element and count() returns the number of elements.
Create, read, add to and count indexed arrays in PHP. Edit the code below and press Run to execute it with real PHP in your browser.
First: 10 Last: 50 Count: 5 Now: 0, 10, 20, 30, 40, 50, 60 Popped: 60
Indexed arrays use integer keys starting at 0. $array[] = $value appends, array_unshift() prepends, array_pop() removes the last element and count() returns the number of elements.