$highest = max($data);
$check = array();
$resultype = array();
foreach($data as $key => $value){
if($value === $highest){
echo $key;
//output (t1,t3);
$check = $key;
}
}
echo $check;
//ouput(t3);
Why is it working when I store the $key
into a array ?
When I echo in $key
in foreach I get what I want (t1,t3) but when I store into and array and output it out side foreach, it only give me (t3).
How do I fix this and store $key
into a array with the result I wanted?