JoshChen_web format encoding UTF8-small details analysis without BOM_PHP tutorial

WBOY
Release: 2016-07-21 14:59:01
Original
782 people have browsed it

However, during the development process, I discovered a small detail problem. You have to open F12 to see it. It turns out that all the referenced things in the head, title, etc., all ran to It's inside my body. I've been thinking hard, but I can't find the answer on Baidu or Google. I had to give up because it did not affect my functions and the style on the page.

Today, when developing other projects, the page uses frameset. I think everyone should understand that frameset can only be used if it is placed outside the body. However, because of this problem, all the contents in the head and frmaeset were moved to the body, and there was a blank line under the body. As a result, the entire page was completely blank, without the desired effect.

Later, I opened the ThinkPHP manual unhappily and continued to learn this framework, but I didn’t expect it. There was a sentence in the ThinkPHP manual that reminded me, which made me interested, and I immediately thought of the possible cause of this problem.
The stickers are as follows:

So, I went to Baidu and looked at the BOM information header. The following is the information found through the data search:

"PHP does not ignore the BOM, so when reading, including or referencing these files, the BOM will be used as part of the beginning text of the file. According to the characteristics of embedded languages, this string of characters will be executed (displayed) directly. As a result, even if the top padding of the page is set to 0, the entire web page cannot be placed close to the top of the browser, because there are these three characters at the beginning of the html! > So, it is because of this problem that the head has been unable to rest. Finally found a solution. So, I downloaded a Notepad++ text editor to modify all my PHP files. After the modification, I successfully succeeded. I felt happy immediately...

After the modification is completed, save and refresh the page.

Look again, the header information is there! ! Done! There is finally no problem with my frameset! The previous project was also completed! So happy! Ha ha! !

That’s what little programmers are like. They get irritated when they encounter little problems and have no patience to solve them. However, after solving it, I discovered the excitement and satisfaction... Ha, programmers, you know, we are actually all very simple!


The language can only be colloquial. It’s not professional. Don’t take offense. I just hope everyone can understand.

http://www.bkjia.com/PHPjc/328170.html

truehttp: //www.bkjia.com/PHPjc/328170.htmlTechArticleHowever, during the development process, I found a small detail problem. You must open F12 to see it. It turns out that , all the referenced things in the head, title, etc., all run...
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