Array to ini file php


 
Array to ini file php
Author
 
Array to ini file php
Name: Radovan Janjic is available for providing paid consulting. Contact Radovan Janjic .
Classes: 14 packages by Radovan Janjic
Country:
Array to ini file php
Serbia
Age:34
All time rank:248 2 in Serbia
Array to ini file php
Week rank:40
Array to ini file php
1 in Serbia
Array to ini file php
Array to ini file php
Innovation award
Array to ini file php

Nominee: 3x

This class can read and write configuration values in INI files.

It can parse a given INI file and extract the contained configuration values into class array variables.

The class can also do the opposite, i.e., write the configuration values in the array variable back to a INI file.


Details

PHP_INI_Read_Write

This class can read and write configuration values in INI files.

It can parse a given INI file and extract the contained configuration values into class array variables.

The class can also do the opposite, i.e., write the configuration values in the array variable back to a INI file.

Examples:

// Parse config.ini
$ini = new INI('config.ini');

// Content of: config.ini
print_r($ini->data);

// Udate settings
$ini->data['first_section']['animal'] = 'COW';

// Save settings to file
$ini->write();

// Update settings
$ini->data['first_section']['animal'] = 'HORSE';

// Add new setting to section third_section
$ini->data['third_section']['phpversion'][] = 5.4;

// Add new section third_section and new item something
$ini->data['fourth_section']['something'] = 'some data';

// Save settings to new file
$ini->write('config-2.ini');

// INI obj is now using ini 2 file
// Content of: config-2.ini
print_r($ini->data);

// Parse config.ini
$ini->read('config.ini');

// Remove item from second_section
unset($ini->data['second_section']['URL']);

// Remove third_section from second ini file and save to third file
unset($ini->data['third_section']);

// Save settings to new file
$ini->write('config-3.ini');

// INI obj is now using ini 3 file
// Content of: config-3.ini
print_r($ini->data);


  Classes of Radovan Janjic  >  PHP INI Read and Write Class  > 
Array to ini file php
Download .zip .tar.gz
 > 
Array to ini file php
Support forum (1)
 > 
Array to ini file php
Blog
 > 
Array to ini file php
Array to ini file php
Latest changes
 

Name:PHP INI Read and Write Class

Array to ini file php
Support forum

Base name:php-ini-class
Description:Read and write configuration values in INI files
Version:1.1
PHP version:4.0.4
License:GNU General Public License (GPL)
All time users:1271 users
All time rank:3009
Week users:0 users
Week rank:142
Array to ini file php
 

  Groups  
Array to ini file php
User ratings
  Applications  
Array to ini file php
Files
 

  Applications that use this package  

No pages of applications that use this class were specified.

Array to ini file php
If you know an application of this package, send a message to the author to add a link here.

 
Array to ini file php
Files
 

How do I write data into an INI file?

Line 1: Load the file into an array. Line 2: set the value. Next lines: Compile ini file content. Last line: write content to disk.

How do I create a PHP INI file?

How to Manually Create a PHP..
Log into your cPanel account..
Open your File Manager..
Navigate to your public_html directory..
Create a new file..
Name it php.ini..
Edit the php.ini file you just created..
Copy and Paste the default php. ini code from the copy of the default version below..
Click Save Changes..

How do I output an array to a file?

We can create an array and use print_r() function to return the array and use the fwrite() function to write the array to the file. The print_r() function takes the array to be printed and the boolean value as the parameters. Use the fopen() function to create a file file.

What is INI file in PHP?

The php. ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits. php. ini file is the configuration file.