What could be the reason for the menu function not working on the web server but working on the local Apache server?

The reason for the menu function not working on the web server but working on the local Apache server could be due to differences in server configurations or PHP settings. To solve this issue, you can try checking the PHP version compatibility, ensuring that the necessary PHP extensions are enabled on the web server, and verifying that the file paths are correct.

<?php
// Check PHP version compatibility
if (version_compare(PHP_VERSION, '7.0.0') >= 0) {
    // Ensure necessary PHP extensions are enabled
    if (extension_loaded('mbstring')) {
        // Verify file paths
        $menu_items = include('/path/to/menu_items.php');
        
        // Display menu items
        foreach ($menu_items as $item) {
            echo '<a href="' . $item['url'] . '">' . $item['title'] . '</a>';
        }
    } else {
        echo 'mbstring extension is not enabled';
    }
} else {
    echo 'PHP version must be 7.0.0 or higher';
}
?>