Is it possible to define a default case in a switch statement to handle missing pages in PHP?

When using a switch statement in PHP to handle different cases, there is no built-in way to define a default case to handle missing pages. However, you can achieve this by using a combination of a default case and an additional condition to check for missing pages.

$page = "about";

switch ($page) {
    case "home":
        echo "Home page content";
        break;
    case "contact":
        echo "Contact page content";
        break;
    default:
        if ($page == "missing") {
            echo "404 Page Not Found";
        } else {
            echo "Default page content";
        }
        break;
}