Associative Array performs same function as that of Indexed Array but unlike Indexed Array which uses Numeric Index, Associative Array uses a String Index for referring to an element of array. In PHP, if you want to create an associative array, you are required to use the => operator.
Associative Array can be specified in following two different ways
Syntax
This will produce following result
Syntax
This will produce following result:
In PHP Associative Array, array count can be done using count() function.
This will produce following result
In PHP Associative Array, array elements can be display using Foreach.
This will produce following result