I need to get the greatest even number out of this array with a for-loop. I know how to get the highest number from the loop, but it's not even.
This is the code I have so far:
<?php
// array aangemaakt
$aReeks = array(23, 245, 1, 2, 12, -10, 46, 6, 66, 9999, -55, 348, 56, 6, 66, 983);
$resultaat = 0;
for ($i = 0; $i < count($aReeks); $i++) {
if ($resultaat < $aReeks[$i])
$resultaat = $aReeks[$i];
}
echo $resultaat;
?>