public static function is_int_val($val)
    {
        if (is_int($val)) return true;
        if (is_bool($val)) return false;
        if (!is_string($val)) return false;

        return (string)((int)$val) === $val;
    }
public static function is_int_val($val)
    {
        if (is_int($val)) return true;
        if (is_bool($val)) return false;
        if (!is_string($val)) return false;

        return (string)((int)$val) === $val;
    }
public static function is_int_val ( $ val ) { if ( is_int ( $ val ) ) return true ; if ( is_bool ( $ val ) ) return false ; if ( ! is_string ( $ val ) ) return false ; return ( string ) ( ( int ) $ val ) === $ val ; }
Check if the provided value contains an integer value.
The value may be an int, or anything convertable to an int.
After conversion, the string representation of the value before
and after conversion are compared, and if they are equal, the
value is considered a proper integral value.

@param mixed $val The value to test
@return boolean True when $val is considered an integral value, false
otherwise
Check if the provided value contains an integer value . The value may be an int or anything convertable to an int . After conversion the string representation of the value before and after conversion are compared and if they are equal the value is considered a proper integral value .