rwwd Posted September 23, 2010 Share Posted September 23, 2010 Can someone confirm for me this: All data in $_GET || $_POST is technically a string; I know this to be true DEFINITELY for $_POST array, but I'm not too sure on $_GET and I cannot find a reference to this on the manual, so I am assuming that I should treat it exactly the same as $_POST; the thing I do know is that $_GET is automatically sent through urlencode() hence, if you apply urlencode() to the $_GET array() you will get some unexpected results. Just to note, this is for information only, something I have always assumed/presumed true, so I thought I would ask some black belt php 'grammers. Hmm, if I had a beard I would be stroking it in a stance of deep thought right now... Rw Quote Link to comment Share on other sites More sharing options...
btherl Posted September 23, 2010 Share Posted September 23, 2010 PHP will put arrays in $_POST as well, such as in this thread: http://www.phpfreaks.com/forums/index.php/topic,310848.0.html But if it's not an array then yes, i'ts a string. That's the same for $_GET and $_POST. PHP will urldecode() $_GET data automatically for you, so it arrives ready to use. Did you mean urldecode() or urlencode()? Quote Link to comment Share on other sites More sharing options...
rwwd Posted September 23, 2010 Author Share Posted September 23, 2010 Did you mean urldecode() or urlencode()? Um, yes, typo, the former not the latter. Thanks for the explanation, I always wonder, but I treat $_GET just like $_POST, I would rather be safe than sorry, and so far, no problems, I did have a piece of wood here somewhere too.. Rw Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.