Mundo Posted February 9, 2009 Share Posted February 9, 2009 I have created some .tpl files, which contain variables (such as "$row['news_Title']"). How can I parse these in a PHP file as simply as possible (preferably using includes)... Any help appreciated. Link to comment https://forums.phpfreaks.com/topic/144467-variables-in-a-template/ Share on other sites More sharing options...
trq Posted February 9, 2009 Share Posted February 9, 2009 example.tpl.php <html> <head><title><?php echo $data['title']; ?></title></head> <body> <p>Hello <?php echo $data['welcome']; ?></p> </body> </html> example.php <?php $data = array('title' => 'foo', 'welcome' => 'bob'); include 'example.tpl.php'; ?> Link to comment https://forums.phpfreaks.com/topic/144467-variables-in-a-template/#findComment-758062 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.