Answer the question
In order to leave comments, you need to log in
Why split a site (PHP)?
Hello.
I'm watching PHP tutorials. There, everyone separates the main file (index.php) into header.php and footer.php.
How is this better than writing everything in one main file (index.php).
I mean files with HTML code, not functions, etc.
Answer the question
In order to leave comments, you need to log in
Flies - separately, cutlets - separately.
1. Website design (header/footer) is one thing, content (index) is another.
2. There are usually more than one page on the site. Often thousands. In order not to duplicate the same thing in each.
By the way, whether to divide into header and footer is a moot point. In my opinion, it is more correct to make one wrapper template and insert content from index.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question