Thinkphp web page source code header empty line solution-PHP development

Source: Internet
Author: User
I accidentally checked the source code of the website of wangzhi blog and found that seven lines were left blank at the top of the source code. What happened? I checked the template and found no blank lines at the top. So I opened the controller and found the problem. The code is blank! Remove the blank lines before and after "" and check the source code of the Web page. There are several blank lines, but there are still two or three blank lines. Open the project model class and remove the blank lines before and after. Once again, open the web page source code and find that the header is completely removed! I accidentally checked the source code of the website of wangzhi blog, and found that seven lines were left blank at the top of the source code,


What's going on?

I checked the template and found no blank lines at the top. So I opened the controller and found the problem,

The code is empty!
Remove" "Blank lines before and after, and then view the web page source code, empty lines are a few less lines, but there are two or three lines of blank. Open the project model class and remove" . Once again, open the web page source code and find that the header is completely removed!


Summary:
The previous verification code could not be properly displayed due to a similar problem, so I had to go over it for several days.ThinkPHP Verification Code SolutionAs mentioned above, I didn't expect empty lines of code to cause empty lines in the source code header of the web page. It seems that there are many problems with empty lines of code and I don't know what problems will be caused in the future. Of course, the above problem is solved for the time being, but that is the way to cure the problem. The method to cure the problem is:Develop good coding habits.

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.