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
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