print the value of an associative array with index using foreach loop.