**
Recently in self-study PHP encountered a little problem, beg all the way hero, thank you!
**
The first case is normal, there is no content output in front of the header (), the picture can be displayed normally after downloading.
The second is the code that needs to be output before the header (). The Ob_start () input cache is set according to the online method. Images cannot be displayed after they are downloaded:
The php.ini output_buffering is configured as follows:
And the same picture according to the above way to download separately, the size of the picture, MD5 value is not the same, degrees Niang no fruit.
What is the cause of the great God, please?
Reference text
Reply content:
**
Recently in self-study PHP encountered a little problem, beg all the way hero, thank you!
**
The first case is normal, there is no content output in front of the header (), the picture can be displayed normally after downloading.
The second is the code that needs to be output before the header (). The Ob_start () input cache is set according to the online method. Images cannot be displayed after they are downloaded:
The php.ini output_buffering is configured as follows:
And the same picture according to the above way to download separately, the size of the picture, MD5 value is not the same, degrees Niang no fruit.
What is the cause of the great God, please?
Reference text
The header function cannot have any character output until it is used.
If you are unsure, use ob_end_clean(); //清空缓冲区并关闭输出缓冲 the function to empty the previous output before using the character output.
None ...
Look at the encoding format of the file, many of these problems are due to the reason why the UTF-8 has a BOM ...
Of course this is going to go wrong because ... hello was also saved as part of the file, contaminated
Now it's understood that the OB startoutput cache has been misunderstoodbefore-the code for OB start and flush straight executes the sentence behind them after the header is output, and should be followed from Ob_start. In this case, the echo content is exported, covering the contents of the back ReadFile ~