Php: how to send postorget Chinese to the server

Source: Internet
Author: User
Php: How do I send postorget Chinese to the server? For example, I want to send the get command to localhost: 12345. I am using file_get_contents (& quot; http: // localhost: 12345? Q = & quot;. & quot; Name & quot php: How do I send post or get Chinese to the server?
For example, I want to send the get command to localhost: 12345. I am using
File_get_contents ("http: // localhost: 12345? Q = "." name ")
Because the last q contains a name, I don't know why it is always difficult for the server to receive it. On the server side, I am using java to perform url. decode (), but it seems that I cannot decode. php to send something like Chinese. What should I do?

------ Solution --------------------
Do not directly perform POST, post encoding, or even secondary encoding, and then perform secondary decoding when using it. the encoding method can be customized as long as it can be restored.

Note that the character set... UTF-8 and gbk cannot be mixed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.