PHP code example of berxam / ranko

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

    

berxam / ranko example snippets



     = new Ranko\App;

    $app->get('/hello', function ($req, $res) {
        $res->sendJSON(['msg' => 'Hello world!']);
    });

    $app->get('/hello/:world', function ($req, $res) {
        $world = $req->params['world'];
        $res->sendHTML("<h1>Hello, $world!</h1>");
    });

    $app->run();