Hello.
I noticed such a thing, that if I pass a string via GET :
?server=Super Server + GF - I in php display the value of $_GET['server'] , and get:
Super Server GF - It turns out that php itself makes urldecode() , when outputting $_GET , and as expected replaces + with a space.
But the question is, is this a setting, or a feature of php? Or is it configured in Apache?
Just now, what would I pass in the GET sign + - I need to do it through JS:
encodeURIComponent('Super Server + GF -')// Super%20Server%20%2B%20GF%20- And only in this case, php will display to me:
Super Server + GF - If you pass to GET :
&test=a+a With the withdrawal we get:
echo $_GET['test'];//aa echo urldecode( $_GET['test'] );//aa It turns out that php still decodes the query string ...
And I don’t understand, does this browser decode the string and transmit it to the server, or does the server decode the string?
encodeURIComponentfrom js (that is, from a browser) - right out of the box. The same with Unicode, the browser sends Unicode - and you cannot guarantee that all browsers do this. - And