Home > Article > Backend Development > Under WIN32, Apache2 reports an error when passing Chinese parameters using the get method.
Problem:
When using the get method to pass Chinese parameters under Apache2 under Win32, an error will occur. For example, test.php?a=你好&b=你好, passing parameters results in an internal error. .
Answer:
Use the urlencode()
function to convert, such as "test.php?a=".urlencode(Hello). "&b=".urlencode(你好)
Detailed introduction:
urlencode()
function is mainly used to return string types , this function will encode the incoming string. The difference between the urlencode() function and the rawencode() function is that the urlencode() function will convert "space" into " "; and the rawencode()
function Then "space" will be converted into " ". Other string conversion methods of the urlencode() function are the same as those of the rawencode() function.
The syntax of the urlencode() function is as follows:
string urlencode (string str)
For more questions, please visit the PHP Chinese website: PHP Video Tutorial
The above is the detailed content of Under WIN32, Apache2 reports an error when passing Chinese parameters using the get method.. For more information, please follow other related articles on the PHP Chinese website!