PROGRAMMING COURSES ADMIN VIDEO TUTORIALS COMMUNITY RESOURCES |
Using loops to iterate over array data is the easiest way to get at all
of the data inside an array for evaluating, parsing, or display. When you loop you
can access many key value pairs with just a few lines of code. You can
conduct any type of operations on the key => value
pairs inside of your loops.
This is how we loop over and display data from a simple value based or associative array: ![]() <?php
Cart Item 1 ______ Key = 0 | Value = Milk
Cart Item 2 ______ Key = 1 | Value = Cheese Cart Item 3 ______ Key = 2 | Value = Eggs Cart Item 4 ______ Key = 3 | Value = Cereal Cart Item 5 ______ Key = 4 | Value = Jelly This is how we loop over and display data from a multidimensional array: ![]() <?php
There are 4 membersMember 1name: Johnzodiac: Scorpio country: USA Member 2name: Susanzodiac: Virgo country: Ireland Member 3name: Williamzodiac: Pisces country: Great Britain Member 4name: Eduardozodiac: Leo country: Mexico
|
|||||||||||
|
|
DevelopPHP Requires Flash Player
___________________________________________
|
||||||||