PHP Array
In this chapter you will learn:
Description
An array is a normal PHP variable, but we can put other variables inside it. Each variable inside an array is called an element. Each element has a key and a value, which can be any other variable.
Two types of arrays
PHP supports two types of arrays:
- Indexed arrays - where each element is referenced by a numeric index, usually starting from zero. For example, the first element has an index of 0, the second has an index of 1, and so on
- Associative arrays (hash or map) - each element is referenced by a string index.
Next chapter...
What you will learn in the next chapter:
- What is Indexed Array and how to create Indexed Array
- Create a PHP array
- Example to create PHP Array
- Array interpolation
Home » PHP Tutorial » PHP Array