PHP code example of digphp / psr15

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

    

digphp / psr15 example snippets

 php
$request_handler = new \DigPHP\Psr15\RequestHandler();
$request_handler->setHandler(function(){
    return 'hello world~';
});
$response = $request_handler->handle('一个实现了 Psr\Http\Message\ServerRequestInterface 的实例');