Re: [PHP] convert a string to integer



thx a lot... i completly skipped this one...i don't know why :-(
now it works

On Fri, Mar 28, 2008 at 8:55 AM, Simon Welsh <simon@xxxxxxxxxxx> wrote:


On 28/03/2008, at 8:48, Alain Roger wrote:
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

is_numeric() - "Finds whether the given variable is numeric. Numeric
strings consist of optional sign, any number of digits, optional
decimal part and optional exponential part."
---
Simon Welsh
Admin of http://simon.geek.nz/

Windows is a joke operating system. Hell, it's not even an operating
system. NT is Not Tough enough for me either. 95 is how may times it
will crash an hour.

http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


Relevant Pages

  • Re: Set Date?
    ... > Can you tell PHP to set the date on your machine? ... > Windows 2000 Pro ...
    (comp.lang.php)
  • RE: HELLPPP!! First time post and desperate
    ... basically i only needed to go to my host file in windows 32 and remove some ... ipconfig / renew and to first flush my dns cahces with ip config /flushdns ... and install sp2 but guess what even sp2 wouldn't install so here i am i am on ... is jilljordan2004@xxxxxxxxxxx thx jj ...
    (microsoft.public.windowsxp.general)
  • Re: Use cookies as authenticate under wince
    ... OK, thx for the information! ... of Windows CE, what device is it running on (it's a Windows Mobile device or ... I'am working on A Web-based interface that is runing at the HTTPD Server ... The server method I'm using is POST ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Win2k API "open file" dialogue box help
    ... >>whatever I'm opening.....small but very annoying problem when you have ... >> hope I'm in the right newsgroup, thx for any tips! ... >not asking a programming question but a Windows configuration question, ...
    (comp.programming)
  • Re: fopen failed to open remote URL
    ... If I use it with a php-script which opens the url with fopen etc. ... failed to open stream: HTTP request failed! ... PHP Version 4.3.10-16 ... thx for any input ...
    (comp.lang.php)