Questions about code that are hard to understand. few posts-php tutorials

Source: Internet
Author: User
The coding problem is hard to understand. I rarely post strange messages. apache + window uses url-included parameters to pass the normal test server linux + apache and uses the same script and the same url (with Chinese parameters, there is a garbled problem .. then input it in the directory of the test server. htaccess write AddDefaultCharsetutf-8 does not make up .. php and html page encoding are all unified. encoding is hard to understand. few posts
It's strange that the url-included parameter transfer is normal in apache + window.
The test server linux + apache uses the same script with the same url (with Chinese parameters) for transmission, leading to garbled characters ..
Then input. htaccess in the directory of the test server to write adddefacharcharset UTF-8 ..

Php and html page encoding are all unified. they are all UTF-8 experts. let's take a look at the first. 100 tips.

------ Solution --------------------
Use urlencode encoding first, and then urldecode decoding.
It is estimated that the English version of linux OS is used.
------ Solution --------------------
Not familiar with lz top
------ Solution --------------------
Try to change the default encoding of linux!
------ Solution --------------------
Url? Urlencode (params), and then urldecode. Or you find that urldecode is not needed at all ..

------ Solution --------------------
URL encoding is required for passing Chinese parameters in the URL.
A. php
PHP code
$ Name = "test"; $ encodeName = urlencode ($ name); echo "URL passing parameter test ";
------ Solution --------------------
Learning

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.