How can PHP be used to display news from a database, with older news displayed normally and newer news in bold?

To display news from a database with older news displayed normally and newer news in bold, you can achieve this by adding a conditional statement in your PHP code to distinguish between older and newer news based on a certain criteria such as date. You can then apply different HTML formatting to the news items based on this condition.

<?php
// Assuming $newsItems is an array of news items fetched from the database
foreach ($newsItems as $news) {
    if ($news['date'] > '2022-01-01') {
        echo '<strong>' . $news['title'] . '</strong><br>';
    } else {
        echo $news['title'] . '<br>';
    }
}
?>