Associative arrays are used to store key and value pairs. For example, to save the marks of the unique subjects of a scholar in an array, a numerically listed array would no longer be a nice choice.



/* Method 1 */
$student = array("key1"=>95, "key2"=>90, "key3"=>93);

/* Method 2 */
$student["key1"] = 95;
$student["key2"] = 90;
$student["key3"] = 93

Suggest An Answer

No suggestions Available!