PHP code example of sopheos / pebble_burn

1. Go to this page and download the library: Download sopheos/pebble_burn 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/ */

    

sopheos / pebble_burn example snippets


Router::getInstance()->get('/user/{any}', function($num) {
    echo 'User n°' . $num;
});

Router::getInstance()->wildcard('date', '[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}');

$http_method = $_SERVER['REQUEST_METHOD'];
$uri = parse_url('http://dummy' . $_SERVER['REQUEST_URI'], PHP_URL_PATH);
Router::getInstance()->run($http_method, $uri)->execute();