What are some alternative approaches to handling template inclusion in PHP?

When including templates in PHP, one common approach is to use the `include` or `require` functions. However, a more flexible and secure alternative is to use the `ob_start` and `ob_get_clean` functions to capture the output of a template file and then include it within the main template file.

// Start output buffering
ob_start();

// Include the template file
include 'template.php';

// Get the contents of the included template
$template_content = ob_get_clean();

// Output the main template with the included template content
echo $template_content;