public static function isInteger($value)
    {
        if (!is_scalar($value) || is_float($value)) {
            return false;
        }
        if (is_int($value)) {
            return true;
        }

        return (bool)preg_match('/^-?[0-9]+$/', $value);
    }
public static function isInteger($value)
    {
        if (!is_scalar($value) || is_float($value)) {
            return false;
        }
        if (is_int($value)) {
            return true;
        }

        return (bool)preg_match('/^-?[0-9]+$/', $value);
    }
public static function isInteger ( $ value ) { if ( ! is_scalar ( $ value ) || is_float ( $ value ) ) { return false ; } if ( is_int ( $ value ) ) { return true ; } return ( bool ) preg_match ( '/^-?[0-9]+$/' , $ value ) ; }
Check that the input value is an integer

This method will accept strings that contain only integer data
as well.

@param string $value The value to check
@return bool
Check that the input value is an integer