PHP code example of vertilia / request

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

    

vertilia / request example snippets




$request = new \Vertilia\Request\HttpRequest(
    $_SERVER,
    $_GET,
    $_POST,
    $_COOKIE,
    file_get_contents('php://input'),
    [
        'id' => ['filter' => \FILTER_VALIDATE_INT, 'options' => ['min_range' => 1]],
        'name' => \FILTER_DEFAULT,
        'email' => \FILTER_VALIDATE_EMAIL,
        'profile' => ['filter' => \FILTER_VALIDATE_URL, 'flags' => \FILTER_FLAG_HOST_REQUIRED],
    ]
);

print_r($request['id']);
print_r($request['name']);
print_r($request['email']);
print_r($request['profile']);