How to Tell if a Number Is Whole in Php

Jul. 7, 2012

if ($num == (int) $num) {
    // It's whole
} else {
    // It's not
}