Home arrow PHP arrow Page 2 - Arrays and PHP: A Primer
PHP

Arrays and PHP: A Primer


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.

Author Info:
By: Tuna Celik
Rating: 4 stars4 stars4 stars4 stars4 stars / 30
December 20, 2001
TABLE OF CONTENTS:
  1. · Arrays and PHP: A Primer
  2. · The fundamentals of memory allocation
  3. · Arrays and their uses
  4. · Single dimension arrays
  5. · Multi-dimensional arrays
  6. · Conclusion

print this article
SEARCH DEVARTICLES

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:

Memory Spaces Example

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:

Data representation in computer memory

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".
blog comments powered by Disqus
PHP ARTICLES

- Removing Singletons in PHP
- Singletons in PHP
- Implement Facebook Javascript SDK with PHP
- Making Usage Statistics in PHP
- Installing PHP under Windows: Further Config...
- File Version Management in PHP
- Statistical View of Data in a Clustered Bar ...
- Creating a Multi-File Upload Script in PHP
- Executing Microsoft SQL Server Stored Proced...
- Code 10x More Efficiently Using Data Access ...
- A Few Tips for Speeding Up PHP Code
- The Modular Web Page
- Quick E-Commerce with PHP and PayPal
- Regression Testing With JMeter
- Building an Iterator with PHP

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials