I have an array as the following:
function example() { /* some stuff here that pushes items with dynamically created key strings into an array */
if you need to return an array elements with same value, use array_keys() function
array_keys()
$array = array('red' => 1, 'blue' => 1, 'green' => 2); print_r(array_keys($array, 1));