Print the value of index array using foreach loop.