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.