PHP Arrays

An array is a special variable that stores one or more values in a single variable.
If you have a list of items, storing them in single variables could look like this:
$item2=" item-name2";
$item3=" item-name3";
An array can hold all your variable values under a single name. And you can access the values by referring to the array name. Each element in the array has its own index so that it can be easily accessed.
In PHP, there are three kind of arrays:
  • Numeric array - An array with a numeric index
  • Associative array - An array where each ID key is associated with a value
  • Multidimensional array - An array containing one or more arrays
HTML references
Basic PHP Syntax
PHP If...Else Statements
PHP For Loops