PHP Array

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.




















Home »
  PHP Tutorial »
    Data Types »




Array
Array Associative
Array Util
ArrayObject
Data Types
Date
Date Format
DateTime
Number
String
String Escape
String Filter
String HTML
String Type
Timezone