Whats in this post?
- Background and Explanation of the code
To copy code: Click “View Source” on the right of this code snippet.
Background and Explanation of the code
A PHP array is declared using the array() function. The most common way to traverse an array is by using the foreach statement. Traversing an array is also demonstrated here by using a while loop which uses the sizeof (variable) function.
1 2 3 4 5 6 7 8 9
a b c d e f g h i