Re: [SOAP] Forcing int to String
| From: | Chris Boget | Date: | Tue, 22 Jul 2003 19:42:55 +0000 |
| Subject: | Re: [SOAP] Forcing int to String | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-871@lists.php.net to get a copy of this message | ||
> Hi, I am running a webservice using, nusoap. I am passing a 10 Digit
> Telephone number, and am getting back, '2146483647'. I know that this
> is the highest value of an Integer on a 32 bit platform, and thats is
> where '2146483647' is coming from.
> What I want to know, is how do I force the Number passed to nusoap to a
> string, instead of an Integer.. I have tried TypeCasting,
> strval($number). It still always returns '2146482647'.
> I don't know if this has been talked about, I searched and Nothing came
> up, can someone give me a hand.?
How are you storing the phone number on the back end? Alternately, how
are you processing it? One way to ensure that a (numerical) phone number
is treated as a string, especially by PHP, is to add some [string] characters.
ie, convert
5551231234
to
(555)123-1234
or
555-123-1234
or however you want to do it. And process it accordingly on the server. But
the point being that when PHP looks at that value, it will definitely see a string
and not an int.
Just a thought.
Chris