[bradgrafelman;11031773]All POST'ed data is treated as string data. Always.]
Thanks; that's what I needed to know most, I think. I'm getting there <grin>!
[That said, there are functions like [man]intval/man (or just casting to (int)) that allow you to convert a string to an integer. Additionally, there are functions like [man]is_numeric/man and [man]ctype_digit/man that will tell you whether a string looks like it could be directly converted to an integer/number/etc.
]
Thanks; I'll look into those functions; ctype is new to me. is_int(...) is what I've been using to see whether the passed input data was integer or not.
EDIT: Also, another question I should ask... does it matter whether or not you have a string or an integer? For most cases in PHP (a loosely-typed language), it does not. Example:
No, not really. It just seemed like it'd be a convenience and save a little checking of input code maybe.
$var = "1";
echo '$var is of type: ' . gettype($var) . "\n";
echo '1 + $var = ' . ( 1 + $var ) . "\n";
The output will show you that PHP is able to understand what you mean by performing mathematical operations on strings. This isn't always desired, of course - try giving $var a value of "2pac".
Yes, I'm aware. 2pac returns false; been playing with something very similar.
Thanks much!
Rivet`🙂