How can a breadcrumb navigation be implemented in PHP?

To implement a breadcrumb navigation in PHP, you can store the navigation links in an array and then loop through the array to display the links with appropriate separators. You can also dynamically generate the links based on the current page's URL.

<?php
// Define an array of breadcrumb links
$breadcrumbs = array(
    'Home' => 'index.php',
    'Products' => 'products.php',
    'Category' => 'category.php'
);

// Display the breadcrumb navigation
echo '<ul>';
foreach ($breadcrumbs as $label => $url) {
    echo '<li><a href="' . $url . '">' . $label . '</a></li>';
}
echo '</ul>';
?>