I have an array as the following:
function example() { /* some stuff here that pushes items with dynamically created key strings into an array */
Yes you can infact php is one of the few languages who provide such support..
foreach($arr as $key=>$value) { }