PHP switch

Last Updated: August 13, 2021

You can write the several if conditions using the switch statement.

This is a good practical example for switch statement

switch ($_GET['action']) {
        case "add_service":
            ck_get_template('service/create.php');
            break;
        case "edit_service":
            ck_get_template('service/edit.php');
            break;
        default:
            ck_get_template('service/index.php');

    }