Is it good practice to add a php include of the head section in my pages?

后端 未结 4 927
我在风中等你
我在风中等你 2021-02-06 11:25

I am creating my portfolio site and I am wanting to include the head section as a php include on my page. Reason being is because the site will have a fair few pages and I will

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-06 12:24

    This is an old topic but I use

        
    

    phpinclude is it's own folder and I keep the footer, header, and common place info in that folder. .js, and .css has it's own as well.

    Edit: I use require now. I would rather have a code fail and die rather than give some random string. They are the same except one dies and the other will print out an error or random code. This is for people learning PHP, not old heads.

提交回复
热议问题