What are some recommended template engines for PHP projects?

When working on PHP projects, using a template engine can help separate the presentation layer from the business logic, making your code more maintainable and easier to work with. Some recommended template engines for PHP projects include Twig, Blade, and Smarty.

// Example using Twig template engine
require_once 'vendor/autoload.php';

$loader = new \Twig\Loader\FilesystemLoader('templates');
$twig = new \Twig\Environment($loader);

echo $twig->render('index.html', ['title' => 'Welcome']);