PHP code example of selfphp / env-schema

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

    

selfphp / env-schema example snippets


use Selfphp\EnvSchema\EnvSchema;

$schema = [
    'APP_ENV' => [
        'type' => 'string',
        'default' => 'production',
        'allowed' => ['dev', 'test', 'production'],
    ],
    'DEBUG' => [
        'type' => 'bool',
        'default' => false,
    ],
    'PORT' => [
        'type' => 'int',
        '
bash
php examples/validate-env.php