For many years, arrays have been used to logically store and sequence data. They have also been the point of confusion for many developers. In this article, Tuna will talk about the structure of arrays and how you can create and manipulate arrays with the PHP scripting language.
Arrays and PHP: A Primer - The fundamentals of memory allocation (Page 2 of 6 )
The diagram shown below illustrates an abstract setup of a row of computer memory. The "Space" rows contain the memory address, while the "Values" rows contain the actual data, which is stored at that address:
For example, if we were to declare a variable named "arthur" in PHP like this:
<?php
$Arthur = "Value Entered";
?>
Then this would be represented in our computers memory, like this:
Notice how the memory address has been replaced with "Arthur". The variable "$Arthur" is simply an alias for the real memory address where the value "Value Entered" is stored. If we were to point the variable $Arthur to another value, like this:
<?php
$Arthur = "New Value";
?>
Then the memory address of the $Arthur variable would remain the same, and its value would be changed to "New Value".