I have an array that have this structure:
[
{
"id": "434073",
"first_name": "Lucio Emanuel",
"last_name": "Chiappero",
"age": "24"
},
{
"id": "330125",
"first_name": "Luis Ezequiel",
"last_name": "Unsain",
"age": "23"
}
my goal is search the player which have the minimum age, that in this case is 23, so Luis Ezequiel
.
So I tried this code:
$index = array_search(min($players["age"]), $players);
the problem's that $index
will return false
, and this is really weird, because the array_search
should find the index of the player which have min
at the age
key.