PHP code example of comphp / config-ini

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

    

comphp / config-ini example snippets


use CommonPHP\Drivers\DriverManager;
use CommonPHP\Configuration\Drivers\IniConfigurationDriver\IniConfigurationDriver;

$driverManager = new DriverManager();
$driverManager->enable(IniConfigurationDriver::class);

$configManager->loadDriver(IniConfigurationDriver::class);
$config = $configManager->get('path/to/configuration.ini');

$config->data['newSection'] = ['newKey' => 'newValue'];
$config->save(); // Persists the changes to 'path/to/configuration.ini'