PHP code example of ppeco / routepp

1. Go to this page and download the library: Download ppeco/routepp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ppeco / routepp example snippets


use ppeco\router\Router;

Router::route("/", function() {
    return "Hello, world!";
});

Router::route("/user/(\d+)", function(array ...$data) {
    return "User #$data[1]";
});

Router::route("/simple", function() {
    return "This is simple pages";
});

echo "Page not found";