when to use index.php instead of index.html

后端 未结 11 2363
星月不相逢
星月不相逢 2020-12-01 02:58

I am relatively new to php. There is a very basic thing that has been troubling me. I understand that php is used to make web sites dynamic. I also understand that php is on

11条回答
  •  Happy的楠姐
    2020-12-01 03:30

    Well you can use HTML if you have a simple few pages where the code doesn't repeat itself a lot. But trust me, if you have a whole website in HTML with more than a thousand lines per file, you will want to use PHP. Why? Because of require and include. These will clean up your code when you need to use layouts, so you don't need to keep copying the hole code of your layout header, footer etc... It can be really difficult to maintain when you need to insert content and there's a lot of code in the way.

    Here's some documentation about it

    https://www.php.net/manual/en/function.include.php

提交回复
热议问题