require_once 'vendor/autoload.php'; use \Pecee\SimpleRouter\SimpleRouter; SimpleRouter::get('/', function() { echo 'Hello, world!'; });
require_once 'vendor/autoload.php'; use \Pecee\SimpleRouter\SimpleRouter; SimpleRouter::get('/user/{id}', function($id) { echo 'User ID: ' . $id; });In this example, we use the `{id}` parameter in the route path to capture the value passed in the URL. The value of this parameter will be passed as an argument to the anonymous function and then printed out to the user. Package library: `pecee/simple-router`