Hi guys, I need some help with an array question. I have the following loop:
$aps = array("192.168.1.10", "192.168.1.70", "192.168.1.38", "192.168.1.12");
reset($aps);
foreach ($aps as $value)
{
$number = rand(5, 15);
}
It runs once for each member of the $aps array. Now when it runs it generates $number. What I need is a way that, once the loop has run, I can find out which $number is the highest and also which value from the $aps array is linked with it.
I hope this make sence. Whats I ideally want is an array like this:
array ("192.168.1.10" -> "7877098",
"192.168.1.70" -> "7877098") etc etc
and a way of returning the highest value and the arrays key.
Thanks, Stuart