PHP code example of em4nl / uresponse

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

    

em4nl / uresponse example snippets




m4nl\U;

// send a 200 response
U\ok('hello, world!');

// 404
U\not_found('this page exists not :(');

// 301
U\moved_permanently('https://example.com/');

// 302
U\found('https://example.com/');