Re: $_GET space in index changed to underscore

From: Date: Fri, 24 Jan 2003 09:09:30 +0000
Subject: Re: $_GET space in index changed to underscore
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-132958@lists.php.net to get a copy of this message
You can use $_SERVER['QUERY_STRING'] Per wrote:
1lt John W. Holmes wrote:
Anyone who knows why get variables whit spaces in looking like this in the URL blah.php?aa+bb=1 is changed to aa_bb in $_GET resulting in $_GET['aa_bb'] instead of $_GET['aa bb']?
That's just what PHP does. It'll also convert any periods in a form element name to an underscore. Otherwise, if you have register globals on, it would try to create a variable of "$aa bb" which doesn't make sense, or "$aa.bb" which doesn't make sense, either, because the dot is a concatinator. ---John Holmes...
Makes some kind of sence I guess... but I think it would be better if those using register_globals=on had to suffer instead of me;) Is there a way to know if the underscore is an original one or just a replacement for an underscore? /P


« previous php.general (#132958) next »