Changes

Jump to: navigation, search

PHP Arrays

782 bytes added, 17:17, 1 June 2007
Accessing Elements of an Associative Array
The result will be the customer name "John Smith" appearing in the browser window.
 
== Creating a Multidimensional Array ==
 
A mutlidimentional array is one in which each element in the array is, itself an array. This can be though of as being similar to a table where each elemt of the parent array represents a row, and each array in the row represents the columns. For example we can create a multidimensional array which contains a muber of books. For each book we will store the author and title of tyhe book in an array:
 
<pre>
$books = array();
$books[0] = array('title'=>'JavaScript in 24 Hours', 'author'=>'Moncur');
$books[1] = array('title'=>'JavaScript Unleashed', 'author'=>'Wyke');
$books[2] = array('title'=>'Network+ Second Edition', 'author'=>'Harwood');
</pre>
 
== Accessing Elements in a Multidimensional Array ==

Navigation menu