Simply compare $numbers[$i] with $highest rather than $numbers[$i+1], initializing $highest = $numbers[0] (outside of the for).
Hope this helps, -gjb-
In reply to Re: finding highest number
by gjb
in thread finding highest number
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |