PHP multidimensional array
In this smal tutorial I will show you how to create and manage multidimensional arrays in PHP.
Tutorial info:
| Name: | PHP multidimensional array |
| Total steps: | 3 |
| Category: | Basics |
| Date: | 2007-06-22 |
| Product: | See complete product |
Bookmark PHP multidimensional array
Step 1 - Introduction
PHP multidimensional array
As you know arrays are a list of key and value pairs. In general the key used to be a number ( or a string in case of associative arrays ) and the value is any data type. And that is important as it means that a value can be an other array as well. So if you create an aeeay where the values are arrays as well then you made a multidimensional array. Of course the values in this internal array can be again a new array and so on.
Let's see an example. Suppose you want to store user informations. In this case you have a lot of users and each user has more properties like name, age, email, website and so on.
- John
- email : john@demo.com
- website : www.john.com
- age : 22
- password : pass
- Anna
- email : anna@demo.com
- website : www.anna.com
- age : 24
- password : pass
- Peter
- email : peter@mail.com
- website : www.peter.com
- age : 42
- password : pass
- Max
- email : max@mail.com
- website : www.max.com
- age : 33
- password : pass
Next Step of PHP multidimensional array
Tags: php multidimensional array, multidimensional array, array, multi-dimensional array
| PHP multidimensional array - Table of contents |
|---|
| Step 1 - Introduction |
| Step 2 - Creating the multi array |
| Step 3 - Print multidimensional array |
