Boring and obvious to everybody who knows about it already. And on this forum that's about 14% of the audience.
For the rest who did not know about the MOD function yet, here it is:
$iNumber = 23;
if (!$iNumber % 2)
{
echo 'number is even';
}
else
{
echo 'number is odd';
};
The mod returns the remainder after deviding the left parameter by the right. So if you devide by two and the remainder is zero, then the number you devided must be even.