Oct
14
2008
0

ZCE Array: Multi-Dimensional Arrays

In this section of the PHP 5 Zend Certification Blog I explain Multi-Dimensional Arrays, put simply its an array inside another array. At first it is confusing but if you start using arrays you will find them useful and very effective.

Array does not have to be a simple list of keys and values; each array element can contain another array as a value, which in turn can hold other arrays as well. In such a way you can create two-dimensional or three-dimensional array.
(more…)

Written by Adam in: 03. Arrays | Tags: , ,
Oct
10
2008
0

ZCE Arrays: Array Iteration

Output Arrays

You can use the simple way, if you know what the index of the value you want to output such as:

echo $Beatles[2]; //outputs George

OR, we can use a loop to output every beetle:

foreach ($Beatles as $Beatle){
 echo "$Beatle";
}

(more…)

Written by Adam in: 03. Arrays | Tags: , , , , ,

WordPress Powered, Theme by TheBuckmaker.com | Add to Technorati Favorites. | RSS and Comments RSS