php – Inserting an element within curly braces in html


Hello! There is such html code:

<meta name="keywords" content="{keywords}">

Instead of {title} and {keywords} information from the database is inserted. I can't understand how this happens. This is the first time I have met such a design. Maybe someone can give an example or just describe how it works


This is a simple templating engine. Principle of operation

str_replace("{title}", $title, "<title>{title}</title>");

Scroll to Top