PHP code example of phpsoftbox / http-emitter

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

    

phpsoftbox / http-emitter example snippets


use PhpSoftBox\Http\Emitter\SapiEmitter;

$emitter = new SapiEmitter();
$emitter->emit($response);

$emitter->emit($response, withoutBody: $request->getMethod() === 'HEAD');