Okay, I've just solved my own problem by simply doing:
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 within the correct range, and if so concantenate it to the
end of the output string.
However bizarrely this seems to behave incorrectly, as it cuts out "0"
as well. Can anyone explain why it does this?
for($x=0;$x < strlen($rawinput);$x++)
$c = substr($rawinput,$x,1);
case ($c > chr(47) and $c < chr(58)):
echo "escaped character at ".$x;
I just can't find the bug in my code at all, and even though I found a
better way to do it, it's annoying me that this didn't work!!!
rss feed: http://bethanoia.dyndns.org/bethanoia.rss
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Re: [PHP] Validating get and post data Beth Gore
- Re: [PHP] Validating get and post data Matt
- Re: [PHP] Validating get and post data Tom Rogers
- Re: [PHP] Validating get and po... Tom Rogers
- RE: [PHP] Validating get and post data Ford, Mike [LSS]