I have an array as the following:
function example() { /* some stuff here that pushes items with dynamically created key strings into an array */
Here is another option
$array = [1=>'one', 2=>'two', 3=>'there']; $array = array_flip($array); echo $array['one'];