|
|
|---|
Arrays in PHPWelcome to the world of Arrays! In this section we will learn about Arrays, Types of Arrays, Storing and Retrieving data from Arrays with examples and explanation. What is an Array?An array is a like a list or a group of similar elements which stores data elements of a specific data type. These data elements are stored in a series inside the array and each of these stored data element has its own position in the Array by which it is referred to and retrieved. The position of these stored elements is maintained by the Index of the Array which is usually made up of consecutive integers beginning at zero. The values which are used to index the elements in an array are unique. That means, you can have only one unique value as an indexer (Key) and no two data elements in an array will have same indexer or the key. See this example:
The above list consists of names of individuals. Note that the position of the first name is starting with zero. Let's see another example of a list.
That was a list of some of the protocols which are most widely used on Internet. Note that the position of the first protocol 'TCP' in the list is zero. Read the next topic on Types of Arrays. |
|
|
|---|