Home  >  Article  >  Backend Development  >  Under WIN32, Apache2 reports an error when passing Chinese parameters using the get method.

Under WIN32, Apache2 reports an error when passing Chinese parameters using the get method.

王林
王林Original
2019-08-23 16:46:012768browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn