> -Original Message-
> From: Beth Gore [mailto:[EMAIL PROTECTED]]
> Sent: 03 December 2002 02:12
>
> However bizarrely this seems to behave incorrectly, as it
> cuts out "0"
> as well. Can anyone explain why it does this?
>
> function stripnum($rawinput)
> {
>
> for($x=0;$x
Hi,
Tuesday, December 3, 2002, 5:17:48 PM, you wrote:
TR> Hi,
TR> Tuesday, December 3, 2002, 12:12:09 PM, you wrote:
BG>> Okay, I've just solved my own problem by simply doing:
BG>> settype($input,"integer");
BG>> but.. I'm puzzled about why the following more complicated solution
BG>> didn't
Hi,
Tuesday, December 3, 2002, 12:12:09 PM, you wrote:
BG> Okay, I've just solved my own problem by simply doing:
BG> settype($input,"integer");
BG> but.. I'm puzzled about why the following more complicated solution
BG> didn't work. The ASCII value for 0 is 48, and for 9 is 57.
BG> The idea w
"John W. Holmes" <[EMAIL PROTECTED]> wrote:
> I think the problem is just the incorrect use of a switch. If you change
> your code to
>
> switch(1)
Or,
switch(true)
for that matter...
- E
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.p
> > I think what's happening here is a type issue. The comparison is
> returning
> a
> > boolean, so when $c != '0', the switch is true and the case is
resolving
> to
> > true, and executing. But when $c == '0', with switch is (false),
but
> the
> > case is true. Change the case to
> > ($c > chr(
Hello,
"Matt" <[EMAIL PROTECTED]> wrote:
> I think what's happening here is a type issue. The comparison is returning
a
> boolean, so when $c != '0', the switch is true and the case is resolving
to
> true, and executing. But when $c == '0', with switch is (false), but the
> case is true. Change
- Original Message -
From: "Beth Gore" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 02, 2002 9:12 PM
Subject: [PHP] Validating get and post data
> Okay, I've just solved my own problem by simply doing:
>
> settype($input,"i
Okay, I've just solved my own problem by simply doing:
settype($input,"integer");
but.. I'm puzzled about why the following more complicated solution
didn't work. The ASCII value for 0 is 48, and for 9 is 57.
The idea was to read a character at a time from the $rawinput string,
check if it's w
8 matches
Mail list logo