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
--- 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) {.
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
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
> 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
5 matches
Mail list logo