php - filter_var and validating integer values -


i'm trying validate if variable 32-bit signed integer.

i thought use filter_var() , filter_validate_int apparently phps definition of int entirely different, 999999999999999999 passes without problem.

looking @ php docs dosn't specific. filter_var($var, filter_validate_int) validate?

i think problem lies more integer:

the size of integer platform-dependent, although maximum value of 2 billion usual value (that's 32 bits signed). 64-bit platforms have maximum value of 9e18, except windows, 32 bit. php not support unsigned integers. integer size can determined using constant php_int_size, , maximum value using constant php_int_max since php 4.4.0 , php 5.0.5.

filter_validate_int allows min_range , max_range passed options. should use those.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -