How do I get the key of the current element in a foreach loop in C#?
foreach
For example:
foreach ($array as $key => $value) {
myKey = Array.IndexOf(values, val);