Why is the submitted rawurlencode () different from the direct output? & Lt ;? & Nbsp; if ($ _ POST ['submit ']) {& nbsp; echo $ _ POST ['name']. & quot; = & lt; br/& gt; & quot; why is the submitted rawurlencode () different from the direct output?
If ($ _ POST ['submit ']) {
Echo $ _ POST ['name']. "=
";
Echo rawurlencode ($ _ POST ['name']);
}
Echo rawurlencode (" ");
?>
In this way, the "woman" is submitted and the result is % C5 % AE % C8 % CB.
Rawurlencode (""): % E5 % A5 % B3 % E4 % BA
Why?
------ Solution --------------------
Because you submitted gbk and your php file was utf8.
------ Solution --------------------
In addition, it is reminded that the form is submitted with urlencode, not rawurlencode, and the JS URIcomponentEncode (is not so spelled) is equivalent to php's rawurlencode, the main difference is whether the space is + or % 20.
The correct result is as follows:
PHP code