In what situations would it be advisable to consider using a template engine like Smarty in PHP for managing repetitive content inclusion?

When dealing with repetitive content inclusion in PHP, using a template engine like Smarty can help separate the presentation logic from the business logic, making the code more maintainable and easier to manage. This can be especially useful when working on large projects with multiple developers or when dealing with complex HTML layouts that require dynamic content insertion.

<?php
require_once('smarty/Smarty.class.php');

$smarty = new Smarty;

$smarty->assign('title', 'Welcome to our website');
$smarty->assign('content', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.');

$smarty->display('template.tpl');
?>