View Single Post
Old 05-21-2009, 12:35 AM   #12 (permalink)
allworknoplay
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
There are ways to also attempt to force an integer. Such as if somebody put in 24a then you could, for instance, typecast that value using (int) and it'd become 24.

However, I wouldn't even bother attempting to purify it. If it's anything other than a number, I would assume they've been fiddling and deny the post.

php Code:
$iNumber = (int) '24a';
var_dump(is_numeric($iNumber)); // True
 

1) Shouldn't you be sleeping?


2)I thought var_dump and print_r were used for arrays? I guess you can use it for other things too?
allworknoplay is offline  
Reply With Quote