phphtmlparsedown

How to parse PHP in HTML without opening PHP?


With some frameworks you can have a HTML page with PHP inside it without opening PHP.

Example:

<html>
    <body>
        <h1>{{title}}</h1>
        <hr />
        {{content}}
    </body>
</html>

So where the value between {{}} defines what needs to be displayed instead of opening and closing PHP every time you need something.

I assume that it is some version of HTML parsedown link, but I would appreciate it if somebody elaborated on this subject.


Solution

  • use shortcode to echo <?=$title;?>

    It's not that much work compared to wrapping everything in {{}}