Why is there such a gap between the source code and the code displayed by the browser following F12:
Untitled Document
Very clean code
Written directly in PHP Chrome F12 at Elements
This is a case. after some code is passed, the above HTML code is directly output.
This is the result of directly writing HTML code to the PHP file. Why is there such a big difference.
Reply to discussion (solution)
You can use the ob function to intercept php output and save it to a file.
Then compare the differences between files
If there is no difference, it is a browser problem, and you can't do anything.
If there is any difference, analyze the reasons for the difference
The code in the middle figure. Strictly speaking, this is also not a standard. However, the browser may have the error correction function, so the effect may be the same.
The code in the middle figure. Strictly speaking, this is also not a standard. However, the browser may have the error correction function, so the effect may be the same.
The first source code is a file created directly with DW! No modifications were made.
I tried Chrome and FF. The source code is the same.
Use F12 development tools in Elements
There are two quotation marks under the Body of the first image.
The second image is the same as the source code.
Very depressing!
Whether your html page contains a UTF8 file with a DOM header in the body. use the editor to convert the page to a file without DOM.
It is the dom header file generated by file editing in Notepad and intermediate transcoding.
We recommend that you directly create a blank file in ue, ediplus, and phpstorm, and copy the existing file content to it.
It is the dom header file generated by file editing in Notepad and intermediate transcoding.
We recommend that you directly create a blank file in ue, ediplus, and phpstorm, and copy the existing file content to it.
Correct BOM instead of DOM.
Whether your html page contains a UTF8 file with a DOM header in the body. use the editor to convert the page to a file without DOM.
BOM rather than DOM
In short, the two of you helped me find the problem !! I have been editing PHP with Editplus all the time. Recently, I have seen that Notepad ++ is quite fresh to use. this is a problem !! That's an emergency !!! I have been tossing for several days and cannot find the cause !!!