Subject not found.
1.

What is associative array in PHP?

Answer»

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.

Example

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

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



Discussion

No Comment Found