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! While you're at it, check out some resources Treehouse students have shared here.

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

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

<?php
 // 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.