Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Mauro Bonucci5,953 Points
White space when using php includes
Hi there, i notice that when i use includes in my files, in my case the header, it appears a white space at the top. But i no that if i change the file to UTF whitout BOM that it resolves. My question is why that this happen?
Jason AnelloCourses Plus Student 94,610 Points
UTF with BOM inserts a few bytes at the beginning of the file to indicate the encoding. This produces the whitespace in your html.
So you always want to save without BOM so you don't have those extra few bytes.