Horje
php simple router script Code Example
php simple router script
<?php

$request = $_SERVER['REQUEST_URI'];

switch ($request) {
    case '/' :
        require __DIR__ . '/views/index.php';
        break;
    case '' :
        require __DIR__ . '/views/index.php';
        break;
    case '/about' :
        require __DIR__ . '/views/about.php';
        break;
    default:
        http_response_code(404);
        require __DIR__ . '/views/404.php';
        break;
}




Php

Related
get type of variable php Code Example get type of variable php Code Example
check image exist or not in laravel Code Example check image exist or not in laravel Code Example
random word using a wordlist php Code Example random word using a wordlist php Code Example
time to string in php Code Example time to string in php Code Example
remove space from start and end of string in php Code Example remove space from start and end of string in php Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7