This is an old revision of the document!
WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0
Get a group of parameters from an INI file as an array
This function reads multiple configuration key/value pairs from an INI file.
$filename: Full path and name of the INI file
$section: Optional, section inside the INI file
If $section is specified: a single-dimensional array, with all key/value pairs in the section.
If $section is not specified: a two-dimensional array containing the entire INI file. The first dimension will contain the sections and the second the key/value pairs.
Given that the file /ini_get_array_example.ini contains:
[settings] name=John age=33
… this code will read the entire INI file into $arr and display the contents:
<pre><? $arr=ini_get_array("/ini_get_array_example.ini"); print_r($arr); ?></pre>
… and the output will be:
[$arr] = Array ( [settings] = Array ( (string) [name] => John (int) [age] => 33 ) )
ini_get() - Get a value from an INI file
ini_put_array() - Write the values from a key/value array to an INI file, with optional section
ini_set() - Write a value to a section in an INI file