Jump to content

Config file, read and write?


Full-Demon

Recommended Posts

If you have an ini file format, eg

[section1]
param1=abc
param2=def

[section2]
color=#C0FFEE
bgd=#000000

 

Then

 

$config = parse_ini_file('config.txt', true);

 

-->

 

array (

  'section1' = array (

        'param1' = 'abc',

        'param2' = 'def'

        ),

 

  'section2' = array (

        'color' = '#C0FFEE',

        'bgd' = '#000000'

)

 

So echo $config['section2']['bgd'] --> #000000

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.