PHP code example of artarts36 / env-editor

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

    

artarts36 / env-editor example snippets


use ArtARTs36\EnvEditor\Editor;

$env = Editor::load('.env')
    ->set('APP_NAME', 'Test APP')
    ->set('APP_ENV', 'local');

$env->save();
// or
Editor::save($env);

var_dump($env->get('APP_NAME'));
var_dump($env->get('APP_ENV'));