Hey. Almost all sites have common parts that are the same for all pages. My question is how technically more correct and more convenient to do the same parts. Suppose different pages have only the middle of the code, the beginning and end are the same. Then you can:
a) Do nothing, each page will have its own identical code. Then if you need to replace something, you will have to edit all pages of the site. When there are more than 15 of them, this already causes some difficulties.
b) as I usually do:
<body> <?php require('top.php'); ?> код страницы <?php require('footer.php'); ?> </body>
In principle, this method is good for everyone, but I doubt that it is correct.
c) there were some php functions, I don’t remember which ones, there the whole page was one code, and pieces of code were inserted into unique places, unique places themselves were designated%. I did not like this method, there were some minuses, I don’t remember already.
d) there is still some way, I am sure.
Help me choose the best way to make such a layout.