I have a .tpl file which contains the HTML code of my webpage and a .php file that I want to use the HTML code in it and replace some variables. For example imagine this is my file.tpl:
<html>
<head>
<title>{page_title}</title>
</head>
<body>
Welcome to {site_name}!
</body>
</html>
and I want to define {page_title} and {site_name} in my php file and display them.
One way we can do this is to load the page code in a variable and then replace {page_title} and {site_name} and then echo them.
But I don't know that it's the best way or not because I think there will be some problem if the .tpl file is large.
Please help me to find the best way. Thanks :-)