What is the best way to insert HTML via PHP?

前端 未结 11 2103
南方客
南方客 2020-12-12 15:26

Talking from a \'best practice\' point of view, what do you think is the best way to insert HTML using PHP. For the moment I use one of the following methods (mostly the lat

11条回答
  •  伪装坚强ぢ
    2020-12-12 16:08

    If a template engine seems to much of a hassle you can make your own poor man's template engine. This example should definately be improved and is not suitable for all tasks, but for smaller sites might be suitable. Just to get you an idea:

    template.inc:

    %title%
    %mainbody%
    Bla bla bla %linkname%.
    
    

    index.php:

    
    

提交回复
热议问题