I have an array as the following:
function example() { /* some stuff here that pushes items with dynamically created key strings into an array */
If the name's dynamic, then you must have something like
$arr[$key]
which'd mean that $key contains the value of the key.
You can use array_keys() to get ALL the keys of an array, e.g.
array_keys()
$arr = array('a' => 'b', 'c' => 'd') $x = array_keys($arr);
would give you
$x = array(0 => 'a', 1 => 'c');