PHP code example of safronik / globals

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

    

safronik / globals example snippets


$get_variable = Get::get('some_Get_variable');
$get_variable = Post::get('some_Post_variable');
$get_variable = Cookie::get('some_Cookie_variable');
$get_variable = Server::get('some_Server_variable');
$get_variable = Request::get('some_Request_variable');

$http_headers = Server::getHTTPHeaders();

$expires   = 0; 
$path      = ''; 
$domain    = 'some.domain'; 
$secure    = true; 
$http_only = true; 
$same_site = 'Lax'; 

$http_headers = Cookie::set(
    'cookie_name',
    'cookie_value',
    $expires,
    $path,
    $domain,
    $secure,
    $http_only,
    $same_site,
);