To create an array, you need several elements.
Use the array()language construct, which is very similar to a function. You call array() and the return value is equal to the new array. Therefore, whatever variable you set as equal to the result of array()becomes an array. For example, take a look at the following:
$newarray = array();
Your new array will be stored in the variable $newarray. Of course, the problem we have now is that this array is blank! We have to create items in the array. Before we do this, let me show you how to reference items in an array.
Array items have two parts: a key and a value. A key is basically the location of the variable, and the value is what is stored ...