Re: [PHP] Re: test if $int is integer

2004-06-30 Thread John W. Holmes
Matthew Sims wrote: I recently purchased George Schlossnagle's Advanced PHP Programming and on page 85 in the Error Handling chapter, he made a reference about the is_int function. In the above function example he had: if (!preg_match('/^\d+$/',$n) || $n < 0) { In which he mentions: It might be

Re: [PHP] Re: test if $int is integer

2004-06-30 Thread Chris Shiflett
--- Matthew Sims <[EMAIL PROTECTED]> wrote: > I recently purchased George Schlossnagle's Advanced PHP Programming and > on page 85 in the Error Handling chapter, he made a reference about the > is_int function. > > In the above function example he had: > if (!preg_match('/^\d+$/',$n) || $n < 0) {.

Re: [PHP] Re: test if $int is integer

2004-06-29 Thread Lars Torben Wilson
Matthew Sims wrote: I recently purchased George Schlossnagle's Advanced PHP Programming and on page 85 in the Error Handling chapter, he made a reference about the is_int function. In the above function example he had: if (!preg_match('/^\d+$/',$n) || $n < 0) { In which he mentions: It might be

Re: [PHP] Re: test if $int is integer

2004-06-29 Thread Mark Leavy
Yeah, 4 will pass the is_int() test, '4' won't. I prefere just to use if(ctype_digit($foo)){ ... } On Tue, 29 Jun 2004 15:12:22 -0700 (PDT), Matthew Sims <[EMAIL PROTECTED]> wrote: > I recently purchased George Schlossnagle's Advanced PHP Programming and on > page 85 in the Error Handling chapter

Re: [PHP] Re: test if $int is integer

2004-06-29 Thread Matthew Sims
> Vlad Georgescu wrote: > >> how can test if var $int is integer ? > > In the manual: > >http://www.php.net/is_int > > Another one which might be helpful: > >http://www.php.net/is_numeric > > > Hope this helps, > > Torben > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscr