This question already has an answer here:
I looked at some questions and answers but didn't find anything. I would like to determine if a number is odd or even. How I can do that?
Example:
odd_or_even(567);
// returns odd
</div>
Use modulo:
if ($id % 2 === 0) {
echo 'even';
} else {
echo 'odd';
}