This will return the first index that has the minimum value in the array. This is useful if you only need one index when the array has multiple instances of the minimum value:
$index = array_search(min($my_array), $my_array);
This will return an array of all indexes that have the minimum value in the array. This is useful if you need all instances of the minimum value, but may be slightly less efficient than the solution above:
$index = array_keys($my_array, min($my_array));
source share