What are the potential pitfalls of using static headers in PHP for dynamic content, title, and meta tags?

When using static headers in PHP for dynamic content, title, and meta tags, the potential pitfalls include SEO issues as search engines may not properly index the dynamic content, difficulty in maintaining and updating the code for each page, and potential duplication of content. To solve this issue, it is recommended to use PHP to dynamically generate the headers based on the content of each page.

<?php
$title = "Dynamic Page Title";
$description = "Dynamic meta description";
$keywords = "keyword1, keyword2, keyword3";

echo "<html>";
echo "<head>";
echo "<title>$title</title>";
echo "<meta name='description' content='$description'>";
echo "<meta name='keywords' content='$keywords'>";
echo "</head>";
echo "<body>";
// Your dynamic content here
echo "</body>";
echo "</html>";
?>