There are three types of arrays in PHP.

1. Numeric array

An array with a numeric index. Values are stored and accessed in linear fashion.The following examples shows two ways of creating an indexed array, the easiest way is:

<?php
    /* First method to create array. */
    $cars = array("Volvo", "BMW", "Toyota");

    foreach( $cars as $value ) {
       echo "Value is $value <br />";
    }

    /* Second method to create array. */
    $numbers[0] = "one";
    $numbers[1] = "two";
    $numbers[2] = "three";

    foreach( $numbers as $value ) {
       echo "Value is $value <br />";
    }
?>

2. Associative array

An array with strings as index. This stores element values in aassociation between key and values.

<?php
    /* First method to associate create array. */
    $array1 = array("name"=>"abc", "age"=>32, "mobile_no"=>9876543210);
    echo $array1["name"]."<br>";
    echo $array1["age"]."<br>";
    echo $array1["mobile_no"]."<br>";
    
    /* Second method to create array. */
    $array2["name"] = "abc";
    $array2["age"] = 32;
    $array2["mobile_no"] = 9876543210;
    echo $array2["name"]."<br>";
    echo $array2["age"]."<br>";
    echo $array2["mobile_no"];
?>

3. Multidimensional array

A multidimensional array is an array containing array of arrays.

<?php
    $marks = array( 
       "abc" => array (
          "physics" => 35,
          "maths" => 30,	
          "chemistry" => 39
       ),

       "xyz" => array (
          "physics" => 30,
          "maths" => 32,
          "chemistry" => 29
       )
    );

    /* Accessing multi-dimensional array values */
    echo $marks['abc']['physics'] . "<br />"; 
    echo $marks['xyz']['maths'] . "<br />"; 

 ?>