Return numerical position of array element
Posted: Sun Apr 18, 2004 8:30 am
Hi,
How can I return the numerical position of an array element even if I have already assigned key values to all of the element?
For example if I've got this array:
And I want to know that "green" is at key position [2] in the array is there a function that will do this?
Looked in the manual but I couldn't find anything except long-winded workarounds that would only work in the specific case I need to do this for.
Any hints?
Thanks
How can I return the numerical position of an array element even if I have already assigned key values to all of the element?
For example if I've got this array:
Code: Select all
$somearray = array ("Blue" => Bluefile.mid", "red" => "redfile.mid", "green" => "greenfile.mid", "orange" => "orangefile.mid" );Looked in the manual but I couldn't find anything except long-winded workarounds that would only work in the specific case I need to do this for.
Any hints?
Thanks