convert a string to integer
- From: raf.news@xxxxxxxxx ("Alain Roger")
- Date: Fri, 28 Mar 2008 08:48:34 +0100
Hi,
i know this topic is obvious but i have a strange behavior and i'm getting
crazy.
my stored procedure returns me a string.
string can be an email or a message error => '-1', '-2', '-3'
when i check if the string contains only digit, i use ctype_digit(mystring)
but any way it returns me false... i suppose that for -1, -2, -3 the "-" is
taken as character and not a digit.
i tried also to cast it before into integer thanks
ctype_digit((int)mystring), but it does not work.
so how can i solve this issue ?
thx
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
- Follow-Ups:
- Re: [PHP] convert a string to integer
- From: Simon Welsh
- Re: [PHP] convert a string to integer
- From: Casey
- Re: [PHP] convert a string to integer
- Prev by Date: Re: [PHP] munge / obfuscate ?
- Next by Date: Re: [PHP] convert a string to integer
- Previous by thread: munge / obfuscate ?
- Next by thread: Re: [PHP] convert a string to integer
- Index(es):
Relevant Pages
|