I'm relatively new to arrays so bear with me. Situation: a = 1 b = 3 c = 5
1st question: How do I echo the largest value's key: "c" to the page?
2nd question: In array_multisort($count, SORT_DESC, $elecCondSort); below, why doesn't it work if I remove $elecCondSort from the parameter?
Benim kod en iyi yaklaşım olup olmadığından emin (basit bir çözüm var ise lütfen). Değil Ayrıca herhangi bir değişiklik lütfen açıklayınız.
$elecCondSort = array(
array ("Condition" => "New", "Count" => 5),
array ("Condition" => "Used", "Count" => 3),
array ("Condition" => "Manufacturer refurbished", "Count" => 1),
);
foreach ($elecCondSort as $key => $row)
{
$condition[$key] = $row["Condition"];
$count[$key] = $row["Count"];
}
array_multisort($count, SORT_DESC, $elecCondSort);
echo $condition[$key].'<br>';