PHP Accessing Associative Arrays
Syntax
Elements in an associative array are accessed using their string keys instead of numeric indices.
$arrayName["key"];Example
// Declaring an associative array$person = ["name" => "Alice", "age" => 25, "city" => "New York"];
// Accessing elementsecho $person["name"]; // Outputs: Aliceecho $person["age"]; // Outputs: 25