The same code on multiple pages, a way to create a template file and include it in all pages?

I have a headline that will be on every page of my site, and instead of adding html/ phpto each page, I thought I could just create a template file and include it with php include()so it is easier to change if I need to change something. Is there a better way to do this and using phpinclude will slow down my site? Thank you in advance.

+4
source share
1 answer

you can use include / require (), but please advise that the same file does not include twice, otherwise it will be conflicting. You can declare a globaly variable to provide you with an easy way.

+1
source

Source: https://habr.com/ru/post/1611385/


All Articles