What is the recommended way to create a navigation in PHP that includes specific URLs?

When creating a navigation in PHP that includes specific URLs, it is recommended to use an associative array to store the page names and their corresponding URLs. This allows for easy maintenance and updating of the navigation links without having to modify each individual link in the code.

<?php
// Define an associative array with page names and their URLs
$navigation = array(
    'Home' => 'index.php',
    'About' => 'about.php',
    'Services' => 'services.php',
    'Contact' => 'contact.php'
);

// Output the navigation links
foreach ($navigation as $page => $url) {
    echo '<a href="' . $url . '">' . $page . '</a> ';
}
?>