Home > Backend Development > PHP Problem > 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.

王林
Release: 2023-02-23 10:48:01
Original
2796 people have browsed it

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)
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template