The example of creating an associative array in PHP is as given below: Hashes (associative arrays) are an extremely useful data structure in the Perl programming language. In the above example, we can use the associative array to store salaries with employees names as the keys, and the value would be their respective salary. Following is the example showing how to create and access numeric arrays.In terms of structure, both the index-by table and nested tables are similar and have subscript to access the elements. NOTE − Don't keep associative array inside double quote while printing otherwise it would not return any value. document.write(''); The following example creates three array elements by string index. In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection.