I have an multidimensional array like this :
$array =
[
['groupe' => 1510, 'nombre' => 3],
['groupe' => 1511, 'nombre' => 10],
['groupe' => 1512, 'nombre' => 5],
['groupe' => 1513, 'nombre' => 4],
['groupe' => 1514, 'nombre' => 3]
];
I want to find the min value for 'nombre' key and return its array. If many arrays have the same min value, I want to return only the first one.
How can I do this ? I found how to get the min value but I can't find how to return its array and only the first found.
To get min value :
$min = min(array_column($array, 'nombre'));