Wednesday, May 29, 2013

Check if number is odd PHP

This is just a quick, simple function to check if a number is odd in PHP.


function odd($int) {
    if ($int === 0) {
        return false;
    } else {
        return true;
    }
}

No comments:

Post a Comment