Programming using arrays is very common. They are variables that can store a large number of information and can be easily handled and used in the programming.
The declaration of an array in PHP is given as follows:
Each space in the array will store the indicated number as shown in the example, using indices starting at zero is possible to store each data. It is important to take into consideration that the array will have its size defined according to the number of elements that are placed on it.
A major advantage of arrays in PHP is the characteristic associative. You do not need to declare a certain position, it can be referenced by a string and store any type of value that is required. Check out the example below:
echo ($vet[‘Name’]. ” ” .$vet[‘Phone’]. ” ” .$vet[‘Value’]);
To declare and manipulate multidimensional arrays using the same format for the declaration of vectors, the difference is that declares more than one position, as shown below:
You can still use multidimensional arrays to store even more data.
The operation of arrays and multidimensional arrays in PHP is critical to the everyday activities of a programmer, with these resources it is possible to manipulate and validate data much faster and logic thus saving processing time.