Re: [PHP] Declaring vars as INT ?

2005-10-22 Thread Richard Lynch
On Fri, October 21, 2005 2:39 pm, Chris Knipe wrote: Function DoSomething($Blah) { $Blah = (int) $Blah; return $Blah } $Blah, cannot be larger than 2147483647, and sometimes, I get negative integers back from the above function. This is with PHP 4.4.0 on FreeBSD 5.4-STABLE. Can

[PHP] Declaring vars as INT ?

2005-10-21 Thread Chris Knipe
Hi, Uhm... Let's take the below quickly: Function DoSomething($Blah) { $Blah = (int) $Blah; return $Blah } $Blah, cannot be larger than 2147483647, and sometimes, I get negative integers back from the above function. This is with PHP 4.4.0 on FreeBSD 5.4-STABLE. Can anyone else perhaps

Re: [PHP] Declaring vars as INT ?

2005-10-21 Thread Jasper Bryant-Greene
On Fri, 2005-10-21 at 21:39 +0200, Chris Knipe wrote: Function DoSomething($Blah) { $Blah = (int) $Blah; return $Blah } $Blah, cannot be larger than 2147483647, and sometimes, I get negative integers back from the above function. This is with PHP 4.4.0 on FreeBSD 5.4-STABLE. Can

RE: [PHP] Declaring vars as INT ?

2005-10-21 Thread Chris Knipe
Aha :) Thanks. -Original Message- From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] Sent: 21 October 2005 22:04 To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] Declaring vars as INT ? On Fri, 2005-10-21 at 21:39 +0200, Chris Knipe wrote: Function

Re: [PHP] Declaring vars as INT ?

2005-10-21 Thread Jordan Miller
Hello, you could treat your variable as a string, and use the is_numeric() function (but this will include floats, too). To answer your question precisely and accurately, you may have to do regex matching since you are out of the bounds of int. However, why, *exactly*, are you trying to

Re: [PHP] Declaring vars as INT ?

2005-10-21 Thread Jordan Miller
Also, look at this function: http://www.php.net/ctype_digit Jordan On Oct 21, 2005, at 2:39 PM, Chris Knipe wrote: Hi, Uhm... Let's take the below quickly: Function DoSomething($Blah) { $Blah = (int) $Blah; return $Blah } $Blah, cannot be larger than 2147483647, and sometimes, I get