Two copies of PHP code, the same codes, why the execution results are different

Source: Internet
Author: User
Rt
My little brother just started to learn PHP, was tortured by this problem for 3 days, just started to think that the environment is not configured correctly, all kinds of Internet search data to solve, are fruitless, and finally found that the installation of wampserver can correctly start localhost, so it feels wrong, Then the index.php copy, delete the extra code, just leave the Echo statement, and then execute in the browser, can display correctly. Then the code in this php file copied to the normal execution of PHP files can not be displayed correctly, pondering half a day do not know why. Ask the great God to give a solution, thank you very much.

I need to upload these two files to reproduce the problem.
File Link:
http://download.csdn.net/detail/huihui_54321/7650745
Image link is as follows:


Reply to discussion (solution)

The file size does not seem to be the same. If you are interested, you can try it. Why this result is present. Solving??

The test-right.php value ANSI is GBK encoded
Test-wrong.php is Unicode-encoded
According to the Unicode encoding standard, the basic ASCII character is also 2 bytes, so the PHP parser does not know, the original output

You're a little bit too damaged in the way you make the download points.

So magical.

This is a little bit too bad for the way you make a download, +1.

Download points are not 0, so the download also has points? Little brother really does not know ...

This is a little bit too bad for the way you make a download, +1.


Download points are not 0, so the download also has points? Little brother really does not know ...

The test-right.php value ANSI is GBK encoded
Test-wrong.php is Unicode-encoded
According to the Unicode encoding standard, the basic ASCII character is also 2 bytes, so the PHP parser does not know, the original output

You're a little bit too damaged in the way you make the download points.

Haha, not intentionally, thank you. It turns out that there is one such situation.
  • 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.