What is the difference between an associative array and a multidimensional array in PHP?

An associative array in PHP is a collection of key-value pairs where each key is unique. On the other hand, a multidimensional array in PHP is an array of arrays, where each element can be accessed by multiple indices. To differentiate between the two, remember that an associative array uses keys as identifiers for values, while a multidimensional array uses nested arrays to store data in a structured manner.

// Associative Array
$person = array(
    "name" => "John",
    "age" => 30,
    "city" => "New York"
);

// Multidimensional Array
$employees = array(
    array("name" => "Alice", "department" => "HR"),
    array("name" => "Bob", "department" => "IT"),
    array("name" => "Charlie", "department" => "Finance")
);