I use Twig and I have an array with keys like this:
array[1] = \"alpha\" array[2] = \"bravo\" array[3] = \"charlie\" array[8] = \"delta\" array[9] = \"echo\"
I guess you want to do the "Iterating over Keys and Values"
As the doc here says, just add "|keys" in the variable you want and it will magically happen.
{% for key, user in users %} {{ key }}: {{ user.username|e }} {% endfor %}
It never hurts to search before asking :)