For example, say:
How do I check if variable
is_int is only for type detection. And request parameters are string by default. So it won't work. http://php.net/is_int
A type independent working solution:
if(preg_match('/^\d+$/D',$post_id) && ($post_id>0)){ print "Positive integer!"; }