View Single Post

  #1 (permalink)  
Old 04-23-2007
Jim
 
Posts: n/a
Default Checking if var is integer string or int

Hi guys,

The variable '$pixels' in the code below may be an integer type or an
integer represented as a string type. I need to check if the value is
indeed one of these. Is the following code the simplest I can get?

if (!is_int($pixels) && !ctype_digit($pixels))
{
// some code
}

Thanks,

Jimmy.

Reply With Quote