How can I find the highest value in the sales key, for this case will be 21, using only "for loop"?
I have been trying to get the values for the sales index in order to find which sale had the highest value, however everything I do, its just simply to run all the array elements and show them into the screen.
$Vehicles = [
"v1" => [
"name" => "Audi",
"model" => "2019",
"sales" => 21
],
"v2" => [
"name" => "BMW",
"model" => "2019",
"sales" => 8
],
"v3" => [
"name" => "Aston Martin",
"model" => "2019",
"sales" => 7
]
];
The highest selling is 21. key = "sales" value = 21