Is this the correct way of putting HTML in PHP?

前端 未结 3 1985
不知归路
不知归路 2021-01-21 12:28

I\'m new to PHP, and most of the time I have been \'echo\'ing my HTML. Today, I found this way of doing it, which makes things 1000 times easier:



        
3条回答
  •  执笔经年
    2021-01-21 12:40

    It is. But it has also become a standard to omit the ending ?> in every file, so there is no trailing whitespace or line ending in the output.

    
    
       

    HTML can go here without echo'ing it

    If enabled in your php.ini, you can also use short tags ( instead of )

提交回复
热议问题