Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Build a Basic PHP Website (2018) Building a Media Library in PHP Including the Header

HTML version declaration missing

In this video she did not mention the version (DOCTYPE html)in the index.php file. Is there any reason for it.

Matthew Mariner
Matthew Mariner
17,666 Points

Generally its best practice to declare your DOCTYPE at the beginning of a HTML document.

Matthew Brock
Matthew Brock
16,791 Points

not all php files return the actual html. There are a lot of times when one php file with include another that has the

<!DOCTYPE hml>

line. Or that line may appear after initial php code like

 // some code 
<!DOCTYPE html>

also realize that the <!DOCTYPE html> is a preferred way (code guideline) to send html it is actually not required and most browsers will show you the text that was sent.