PHP code example of ocolin / global-type

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

    

ocolin / global-type example snippets


use Ocolin\GlobalType\GET;
$_GET['parameter'] = 'value';

$value = GET::getString( name: 'parameter' );
// string(5) "value"

$value = GET::getInt( name: 'parameter' );
// int(0)

$value = GET::getIntNull( name: 'parameter' );
// NULL

$value = GET::getInt( name: 'parameter', default: 777 );
//int(777)